gl_locker_handle

The Google Locker for WordPress gl locker handle function.

Description

gl_locker_handle( $atts, $content ); 

Parameters (2)

0. $atts
The atts.
1. $content
The content.

Usage

  1. if ( !function_exists( 'gl_locker_handle' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-locker-for-wordpress/admin/shortcode.php'; 
  3.  
  4. // The atts. 
  5. $atts = null; 
  6.  
  7. // The content. 
  8. $content = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = gl_locker_handle($atts, $content); 
  12.  

Defined (1)

The function is defined in the following location(s).

/admin/shortcode.php  
  1. function gl_locker_handle( $atts, $content ) { 
  2. // Extract variables from shortcode tag, set defaults 
  3. extract( shortcode_atts( array( 
  4. "type" => 'social' 
  5. ), $atts ) ); 
  6.  
  7. $type = strtolower( $type );  
  8. $postID = get_the_ID(); 
  9.  
  10. // Check Cookies 
  11. if ( $type == 'social' && $_COOKIE["g_locker_social"] == 'true') { 
  12. return do_shortcode( $content ); 
  13. else if ( $type == 'content' && $_COOKIE["g_locker_" . $postID . "_content"] == 'true') { 
  14. return do_shortcode( $content ); 
  15. else { 
  16. // General Values 
  17. $general_settings = gl_get_general_settings_values(); 
  18.  
  19. // Configure Urls 
  20. $youtube_channel = $general_settings[ 'youtube_channel' ]; 
  21. $googleurl = ( ($type == 'social') ? $general_settings[ 'google_url' ] : gl_current_page() ); 
  22. return gl_generate( $content, $type, $googleurl, $youtube_channel );