function __construct() { if (Is_Admin() && !$this->Validate_Licence()) { $this->base_url = get_bloginfo('wpurl') . '/' . Str_Replace("\\", '/', SubStr(RealPath(DirName(__FILE__)), Strlen(ABSPATH))); Add_Action('admin_init', array($this, 'Load_TextDomain')); Add_Action('admin_init', array($this, 'Add_Contribution_Code_Field')); Add_Action('admin_print_footer_scripts', array($this, 'Print_Contribution_JS'), 99); Add_Action('admin_notices', array($this, 'Print_Contribution_Form'), 1); Add_Action('wp_dashboard_setup', array($this, 'Register_Dashboard_Widget'), 9); Add_Action('donation_message', array($this, 'Print_Contribution_Message')); Add_Action('dh_contribution_message', array($this, 'Print_Contribution_Message')); } $this->Check_Remote_Activation(); }
function __construct() { // Read base $this->base_url = get_bloginfo('wpurl') . '/' . Str_Replace("\\", '/', SubStr(RealPath(DirName(__FILE__)), Strlen(ABSPATH))); // Get ready to translate $this->Load_TextDomain(); // Set Hooks if (Is_Admin()) { Add_Action('admin_menu', array($this, 'add_options_page')); Add_Action('admin_head', array($this, 'print_admin_header')); } else { Add_Action('wp_head', array($this, 'print_header')); Add_ShortCode('gallery', array($this, 'gallery_shortcode')); } // Add jQuery wp_enqueue_script('jquery'); }
static function filterQuery($query) { if (!$query->Get('suppress_filters') && Core::isGlossaryArchive($query) || Core::isGlossarySearch($query)) { # Order the terms in the backend by title, ASC. if (!$query->Get('order')) { $query->Set('order', 'asc'); } if (!$query->Get('orderby')) { $query->Set('orderby', 'title'); } # Take an eye on the filter if (!$query->Get('post_title_like') && !$query->Get('ignore_filter_request') && Get_Query_Var('filter')) { $query->Set('post_title_like', RawUrlDecode(Get_Query_Var('filter')) . '%'); } # Change the number of terms per page if (!Is_Admin()) { $query->Set('posts_per_page', Options::Get('terms_per_page')); } } }
function __construct() { // If we are not in admin panel. We bail out. if (!Is_Admin()) { return False; } // Load Text Domain $this->Load_TextDomain(); // Register the Misc Setting if a user donated Add_Action('admin_menu', array($this, 'add_settings_field')); // Check if the user has already donated if (get_option('donated_to_dennis_hoppe') == 'yes') { return False; } // Add some Js for the donation buttons to the admin header Add_Action('admin_head', array($this, 'print_donation_js')); // Hide the donation form to the footer Add_Action('admin_notices', array($this, 'print_donation_form'), 1); // Register the Dashboard Widget Add_Action('wp_dashboard_setup', array($this, 'register_widget')); // Register donation message Add_Action('donation_message', array($this, 'print_message')); }
function Filter_The_Tags($str_tag_list, $before, $separator, $after, $post_id) { $post = Get_Post($post_id); if (!Is_Admin()) { $gallery_taxonomy = 'gallery_tag'; $taxonomy_exists = Taxonomy_Exists($gallery_taxonomy); $is_gallery = $post->post_type == $this->gallery_post_type->name; $uses_post_tags = Is_Object_in_Taxonomy($post->post_type, 'post_tag'); $uses_gallery_tags = Is_Object_in_Taxonomy($post->post_type, $gallery_taxonomy); if ($taxonomy_exists && $is_gallery && !$uses_post_tags && $uses_gallery_tags) { $str_tag_list = Get_The_Term_List($post_id, $gallery_taxonomy, $before, $separator, $after); } } return $str_tag_list; }