PHP Функция add_filter - примеры использования

На этой странице представлены лучшие примеры PHP кода для метода add_filter, полученные из open source проектов. Вы можете ставить оценку каждому примеру, чтобы помочь нам улучшить качество примеров.
Пример #1
Показать файл Файл: options.php Проект: leshuis/testwp
0
function optionscheck_change_santiziation()
{
    remove_filter('of_sanitize_textarea', 'of_sanitize_textarea');
    remove_filter('of_sanitize_text', 'sanitize_text_field');
    add_filter('of_sanitize_textarea', 'custom_sanitize_input');
    add_filter('of_sanitize_text', 'custom_sanitize_input');
}
Пример #2
Показать файл Файл: epl-global-discount-manager.php Проект: Kemitestech/WordPress-Skeleton
0
 function __construct()
 {
     parent::__construct();
     epl_log('init', get_class() . "  initialized", 1);
     $this->epl->load_config('global-discount-fields');
     $this->ecm = $this->epl->load_model('epl-common-model');
     global $epl_fields;
     $this->fields = $epl_fields;
     //$this->epl_fields = $this->epl_util->combine_array_keys( $this->fields );
     $this->epl_fields = $epl_fields;
     $post_ID = '';
     if (isset($_GET['post'])) {
         $post_ID = $_GET['post'];
     } elseif (isset($_POST['post_ID'])) {
         $post_ID = $_POST['post_ID'];
     }
     $this->data['values'] = $this->ecm->get_post_meta_all((int) $post_ID, false, true);
     $this->edit_mode = epl_get_element('post', $_GET) || epl_get_element('post_ID', $_REQUEST);
     if (isset($_REQUEST['epl_ajax']) && $_REQUEST['epl_ajax'] == 1) {
         $this->run();
     } else {
         add_action('default_title', array($this, 'pre'));
         add_action('add_meta_boxes', array($this, 'epl_add_meta_boxes'));
         add_action('save_post', array($this, 'save_postdata'));
         add_filter('manage_edit-' . self::post_type . '_columns', array($this, 'add_new_columns'));
         add_action('manage_' . self::post_type . '_posts_custom_column', array($this, 'column_data'), 10, 2);
     }
 }
Пример #3
Показать файл Файл: sidebar-highlight.php Проект: hyyan/sidebar-highlight
0
 /**
  * Constrcut the plugin
  */
 public function __construct()
 {
     add_filter('is_active_sidebar', array($this, 'activateSidebars'));
     add_action('dynamic_sidebar_before', array($this, 'before'));
     add_action('dynamic_sidebar_after', array($this, 'after'));
     add_action('wp_enqueue_scripts', array($this, 'assets'));
 }
Пример #4
Показать файл Файл: wp-abstract.php Проект: recordsonribs/wp-abstract
0
 function init()
 {
     $args = array('labels' => $this->create_labels(), 'description' => '', 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'show_in_menu' => true, 'menu_position' => 50, 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt'), 'register_meta_box_cb' => array($this, 'metaboxes'), 'rewrite' => array('slug' => strtolower($this->single), 'with_front' => false, 'feeds' => true, 'pages' => true), 'can_export' => true, 'show_in_nav_menus' => true);
     $args = array_merge($args, $this->overwrite);
     register_post_type($this->name, $args);
     add_filter('post_updated_messages', array($this, 'post_updated_messages'));
 }
Пример #5
Показать файл Файл: Calendar.php Проект: julbrygd/wp-club
0
 public function public_init()
 {
     add_filter("previous_post_link", array(&$this, "linkFilter"));
     add_filter("next_post_link", array(&$this, "linkFilter"));
     add_shortcode('club_event', array(&$this, 'eventShortCode'));
     $this->urlHandler();
 }
Пример #6
Показать файл Файл: wpml.php Проект: slavic18/cats
0
 function __construct()
 {
     // global
     global $sitepress;
     // vars
     $this->lang = ICL_LANGUAGE_CODE;
     // update settings
     acf_update_setting('default_language', $sitepress->get_default_language());
     acf_update_setting('current_language', $this->lang);
     // actions
     add_action('acf/verify_ajax', array($this, 'verify_ajax'));
     add_action('acf/field_group/admin_head', array($this, 'admin_head'));
     add_action('acf/input/admin_head', array($this, 'admin_head'));
     // bail early if not transaltable
     if (!$this->is_translatable()) {
         return;
     }
     // actions
     add_action('acf/upgrade_start/5.0.0', array($this, 'upgrade_start_5'));
     add_action('acf/upgrade_finish/5.0.0', array($this, 'upgrade_finish_5'));
     add_action('acf/update_field_group', array($this, 'update_field_group'), 2, 1);
     add_action('icl_make_duplicate', array($this, 'icl_make_duplicate'), 10, 4);
     // filters
     add_filter('acf/settings/save_json', array($this, 'settings_save_json'));
     add_filter('acf/settings/load_json', array($this, 'settings_load_json'));
 }
Пример #7
Показать файл Файл: functions.php Проект: besimhu/legacy
0
function Destro_setup()
{
    // This theme uses wp_nav_menu() in one location.
    register_nav_menus(array('mainmenu' => __('Main Navigation', 'Destro')));
    // This theme uses post thumbnails
    add_theme_support('post-thumbnails');
    add_image_size('Destrothumb', 450, 300, true);
    // Add default posts and comments RSS feed links to head
    add_theme_support('automatic-feed-links');
    // Add translation support
    load_theme_textdomain('Destro', get_template_directory() . '/languages');
    // Delete default WordPress gallery css
    add_filter('use_default_gallery_style', '__return_false');
    // Add Custom background feature
    if (of_get_option('skin_style')) {
        $custombgargsskin = of_get_option('skin_style');
    } else {
        $custombgargsskin = 'destro';
    }
    if (get_stylesheet_directory() == get_template_directory()) {
        $custombgargs = array('default-color' => '292929', 'default-image' => get_template_directory_uri() . '/images/' . $custombgargsskin . '/page_bg.png');
    } else {
        $custombgargs = array('default-image' => get_stylesheet_directory_uri() . '/images/page_bg.png');
    }
    add_theme_support('custom-background', $custombgargs);
}
Пример #8
Показать файл Файл: TLPteamPostTypeAdmin.php Проект: WildCodeSchool/projet-maison_ados_dreux
0
 function __construct()
 {
     add_filter('manage_edit-team_columns', array($this, 'arrange_team_columns'));
     add_action('manage_team_posts_custom_column', array($this, 'manage_team_columns'), 10, 2);
     // add_action( 'restrict_manage_posts', array( $this, 'add_taxonomy_filters' ) );
     add_filter("manage_edit-team_sortable_columns", array($this, 'team_column_sort'));
 }
Пример #9
Показать файл Файл: tracking_importer.php Проект: johannes-mueller/podlove-publisher
0
 public static function init()
 {
     if (!is_admin()) {
         return;
     }
     if (!isset($_FILES['podlove_import_tracking'])) {
         return;
     }
     set_time_limit(10 * MINUTE_IN_SECONDS);
     // allow xml+gz uploads
     add_filter('upload_mimes', function ($mimes) {
         return array_merge($mimes, array('xml' => 'application/xml', 'gz|gzip' => 'application/x-gzip'));
     });
     require_once ABSPATH . '/wp-admin/includes/file.php';
     $file = wp_handle_upload($_FILES['podlove_import_tracking'], array('test_form' => false));
     if ($file && (!isset($file['error']) || !$file['error'])) {
         update_option('podlove_import_tracking_file', $file['file']);
         if (!($file = get_option('podlove_import_tracking_file'))) {
             return;
         }
         $importer = new \Podlove\Modules\ImportExport\Import\TrackingImporter($file);
         $importer->import();
     } else {
         echo '<div class="error"><p>' . $file['error'] . '</p></div>';
     }
 }
Пример #10
Показать файл Файл: class-wpfront-user-role-editor-login-redirect.php Проект: Benrajalu/philRaj
0
 public function __construct($main)
 {
     parent::__construct($main);
     add_filter('login_redirect', array($this, 'login_redirect_callback'), 10, 3);
     add_action('admin_init', array($this, 'admin_init'));
     add_filter('show_admin_bar', array($this, 'show_toolbar'), 10, 1);
 }
Пример #11
Показать файл Файл: Admin.php Проект: Vatia13/tofido
0
 protected function _initHooks()
 {
     add_action('admin_init', array($this, 'admin_init'), 20);
     add_action('admin_menu', array($this, 'admin_menu'));
     add_action('network_admin_menu', array($this, 'network_admin_menu'));
     add_action('admin_head', array($this, 'admin_head'));
     add_action('wp_dashboard_setup', array($this, 'dashboard_setup'));
     add_action('wp_ajax_better-analytics_heatmaps', array($this, 'display_page'));
     add_action('wp_ajax_better-analytics_area_charts', array($this, 'display_page'));
     add_action('wp_ajax_better-analytics_monitor', array($this, 'display_page'));
     add_action('wp_ajax_better-analytics_events', array($this, 'display_page'));
     add_action('wp_ajax_better-analytics_charts', array($this, 'display_charts'));
     add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2);
     add_filter('wp_redirect', array($this, 'filter_redirect'));
     add_filter('admin_footer_text', array($this, 'admin_footer_text'));
     add_filter('all_plugins', array($this, 'all_plugins'));
     add_filter('plugin_row_meta', array($this, 'plugin_row_meta'), 10, 2);
     add_filter('wpmu_options', array($this, 'show_network_settings'));
     add_action('update_wpmu_options', array($this, 'save_network_settings'));
     add_filter('removable_query_args', array($this, 'removable_query_args'));
     $betterAnalyticsOptions = get_option('better_analytics');
     if (!$betterAnalyticsOptions['property_id']) {
         add_action('admin_notices', array($this, 'not_configured'));
     }
     if (!get_site_option('ba_site_tokens') && !get_option('ba_tokens')) {
         add_action('admin_notices', array($this, 'cant_auto_configure'));
     } elseif (!$betterAnalyticsOptions['api']['profile']) {
         add_action('admin_notices', array($this, 'can_auto_configure'));
     }
     if (get_transient('ba_last_error')) {
         add_action('admin_notices', array($this, 'last_error'));
     }
 }
Пример #12
Показать файл Файл: theme_editor.php Проект: aguidetta/Enduris
0
 /**
  * Constructor
  */
 public function __construct()
 {
     add_filter('metaslider_css', array($this, 'get_theme_css'), 15, 3);
     add_filter('metaslider_css_classes', array($this, 'get_theme_css_classes'), 10, 3);
     add_action('admin_menu', array($this, 'register_theme_editor_menu'), 9556);
     add_filter('metaslider_get_available_themes', array($this, 'get_theme_select_options'), 10, 2);
 }
Пример #13
Показать файл Файл: wc-edostavka.php Проект: kalbac/wc-edostavka
0
 /**
  *
  */
 private function __construct()
 {
     register_activation_hook(__FILE__, array($this, 'activate'));
     $this->includes();
     if (is_admin()) {
         $this->admin_includes();
     }
     add_filter('woocommerce_shipping_methods', array($this, 'add_method'));
     add_filter('woocommerce_checkout_fields', array($this, 'add_delivery_points_field'), 99);
     add_filter('woocommerce_default_address_fields', array($this, 'default_address_fields'), 99);
     add_filter('woocommerce_country_locale_field_selectors', array($this, 'add_city_id_field_selector'));
     add_filter('woocommerce_form_field_hidden', array($this, 'form_field_hidden'), 10, 4);
     add_action('woocommerce_after_checkout_billing_form', array($this, 'delivery_points_map'));
     add_action('woocommerce_checkout_process', array($this, 'delivery_point_field_process'));
     add_action('woocommerce_checkout_update_order_review', array($this, 'update_order_review'));
     add_action('woocommerce_checkout_update_order_meta', array($this, 'checkout_field_update_order_meta'));
     add_action('woocommerce_email_order_meta', array($this, 'email_order_meta'), 99);
     add_filter('default_checkout_state', array($this, 'default_checkout_state'));
     add_filter('pre_update_option_woocommerce_' . self::$method_id . '_settings', array($this, 'check_shop_contract'), 10, 2);
     add_filter('woocommerce_cart_shipping_packages', array($this, 'shipping_packages'), 10);
     //Ajax
     add_filter('woocommerce_update_order_review_fragments', array($this, 'ajax_update_delivery_points'));
     add_filter('woocommerce_params', array($this, 'is_door_params'));
     add_action('wp_enqueue_scripts', array($this, 'load_script'));
     add_action('admin_enqueue_scripts', array($this, 'admin_load_script'));
 }
Пример #14
Показать файл Файл: functions.php Проект: hamednourhani/gsalborz
0
function gsalborz_ahoy()
{
    //Allow editor style.
    //add_editor_style( get_stylesheet_directory_uri() . '/library/css/editor-style.css' );
    // let's get language support going, if you need it
    load_theme_textdomain('gsalborz', get_template_directory() . '/languages');
    // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY
    require_once 'library/custom-post-type.php';
    // launching operation cleanup
    add_action('init', 'gsalborz_head_cleanup');
    // A better title
    add_filter('wp_title', 'rw_title', 10, 3);
    // remove WP version from RSS
    add_filter('the_generator', 'gsalborz_rss_version');
    // remove pesky injected css for recent comments widget
    add_filter('wp_head', 'gsalborz_remove_wp_widget_recent_comments_style', 1);
    // clean up comment styles in the head
    add_action('wp_head', 'gsalborz_remove_recent_comments_style', 1);
    // clean up gallery output in wp
    add_filter('gallery_style', 'gsalborz_gallery_style');
    // enqueue base scripts and styles
    add_action('wp_enqueue_scripts', 'gsalborz_scripts_and_styles', 999);
    // ie conditional wrapper
    // launching this stuff after theme setup
    gsalborz_theme_support();
    // adding sidebars to Wordpress (these are created in functions.php)
    add_action('widgets_init', 'gsalborz_register_sidebars');
    // cleaning up random code around images
    add_filter('the_content', 'gsalborz_filter_ptags_on_images');
    // cleaning up excerpt
    add_filter('excerpt_more', 'gsalborz_excerpt_more');
}
Пример #15
Показать файл Файл: class-itsec-malware-admin.php Проект: santikrass/apache
0
 function run($core)
 {
     $this->core = $core;
     $this->settings = get_site_option('itsec_malware');
     $this->module_path = ITSEC_Lib::get_module_path(__FILE__);
     add_action('itsec_add_admin_meta_boxes', array($this, 'add_admin_meta_boxes'));
     //add meta boxes to admin page
     add_action('itsec_admin_init', array($this, 'initialize_admin'));
     //initialize admin area
     add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
     //enqueue scripts for admin page
     add_action('wp_ajax_itsec_malware_request_url_scan_ajax', array($this, 'wp_ajax_itsec_malware_request_url_scan_ajax'));
     //Execute manual homepage scan request
     add_action('wp_ajax_itsec_malware_get_scan_results_ajax', array($this, 'wp_ajax_itsec_malware_get_scan_results_ajax'));
     //Execute manual homepage scan report
     add_filter('itsec_add_dashboard_status', array($this, 'dashboard_status'));
     //add information for plugin status
     add_filter('itsec_tracking_vars', array($this, 'tracking_vars'));
     add_filter('itsec_logger_displays', array($this, 'itsec_logger_displays'));
     //adds logs metaboxes
     //manually save options on multisite
     if (is_multisite()) {
         add_action('itsec_admin_init', array($this, 'save_network_options'));
         //save multisite options
     }
 }
Пример #16
Показать файл Файл: class.pmprogateway_paypalstandard.php Проект: TakenCdosG/admissionsrevolution_new
0
 /**
  * Run on WP init
  *		 
  * @since 1.8
  */
 static function init()
 {
     //make sure PayPal Express is a gateway option
     add_filter('pmpro_gateways', array('PMProGateway_paypalstandard', 'pmpro_gateways'));
     //add fields to payment settings
     add_filter('pmpro_payment_options', array('PMProGateway_paypalstandard', 'pmpro_payment_options'));
     /*
     	This code is the same for PayPal Website Payments Pro, PayPal Express, and PayPal Standard
     	So we only load it if we haven't already.
     */
     global $pmpro_payment_option_fields_for_paypal;
     if (empty($pmpro_payment_option_fields_for_paypal)) {
         add_filter('pmpro_payment_option_fields', array('PMProGateway_paypalstandard', 'pmpro_payment_option_fields'), 10, 2);
         $pmpro_payment_option_fields_for_paypal = true;
     }
     //code to add at checkout
     $gateway = pmpro_getGateway();
     if ($gateway == "paypalstandard") {
         add_filter('pmpro_include_billing_address_fields', '__return_false');
         add_filter('pmpro_include_payment_information_fields', '__return_false');
         add_filter('pmpro_required_billing_fields', array('PMProGateway_paypalstandard', 'pmpro_required_billing_fields'));
         add_filter('pmpro_checkout_default_submit_button', array('PMProGateway_paypalstandard', 'pmpro_checkout_default_submit_button'));
         add_filter('pmpro_checkout_before_change_membership_level', array('PMProGateway_paypalstandard', 'pmpro_checkout_before_change_membership_level'), 10, 2);
     }
 }
Пример #17
Показать файл Файл: class-translation-text-addons.php Проект: iq007/MadScape
0
 function __construct()
 {
     /*
      * Initialize addons text.
      */
     add_filter('dopbsp_filter_translation_text', array(&$this, 'addons'));
 }
Пример #18
Показать файл Файл: pb-sanitize.php Проект: JackDougherty/pressbooks
0
/**
 * Setup a filter that removes style from WP audio shortcode
 *
 * @see \wp_audio_shortcode (in /wp-includes/media.php line ~1658)
 */
function fix_audio_shortcode()
{
    add_filter('wp_audio_shortcode', function ($html, $atts, $audio, $post_id, $library) {
        $html = str_replace('width: 100%; visibility: hidden;', '', $html);
        return $html;
    }, 10, 5);
}
Пример #19
Показать файл Файл: cool-video-gallery.php Проект: ejoan/erikajoan.com
0
 function CoolVideoGallery()
 {
     $this->plugin_url = trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__)));
     $this->video_player_url = trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__)) . '/cvg-player');
     $this->video_player_path = trailingslashit(WP_CONTENT_DIR . '/plugins/' . dirname(plugin_basename(__FILE__)) . '/cvg-player/');
     $this->table_gallery = '';
     $this->table_videos = '';
     $this->video_id = '';
     if (function_exists('is_multisite') && is_multisite()) {
         $this->default_gallery_path = get_option('upload_path') . '/video-gallery/';
     } else {
         $this->default_gallery_path = 'wp-content/uploads/video-gallery/';
     }
     $this->winabspath = str_replace("\\", "/", ABSPATH);
     $this->load_video_files();
     //adds scripts and css stylesheets
     add_action('wp_print_scripts', array(&$this, 'gallery_script'));
     //adds admin menu options to manage
     add_action('admin_menu', array(&$this, 'admin_menu'));
     //adds contextual help for all menus of plugin
     add_action('admin_init', array(&$this, 'add_gallery_contextual_help'));
     //adds player options to head
     add_action('wp_head', array(&$this, 'addPlayerHeader'));
     add_action('admin_head', array(&$this, 'addPlayerHeader'));
     //adds filter for post/page content
     add_filter('the_content', array(&$this, 'CVGVideo_Parse'));
     add_filter('the_content', array(&$this, 'CVGGallery_Parse'));
     add_action('wp_dashboard_setup', array(&$this, 'cvg_custom_dashboard_widgets'));
 }
Пример #20
Показать файл Файл: class-wc-session-handler.php Проект: jgcopple/drgaryschwantz
0
 /**
  * Constructor for the session class.
  */
 public function __construct()
 {
     global $wpdb;
     $this->_cookie = 'wp_woocommerce_session_' . COOKIEHASH;
     $this->_table = $wpdb->prefix . 'woocommerce_sessions';
     if ($cookie = $this->get_session_cookie()) {
         $this->_customer_id = $cookie[0];
         $this->_session_expiration = $cookie[1];
         $this->_session_expiring = $cookie[2];
         $this->_has_cookie = true;
         // Update session if its close to expiring
         if (time() > $this->_session_expiring) {
             $this->set_session_expiration();
             $this->update_session_timestamp($this->_customer_id, $this->_session_expiration);
         }
     } else {
         $this->set_session_expiration();
         $this->_customer_id = $this->generate_customer_id();
     }
     $this->_data = $this->get_session_data();
     // Actions
     add_action('woocommerce_set_cart_cookies', array($this, 'set_customer_session_cookie'), 10);
     add_action('woocommerce_cleanup_sessions', array($this, 'cleanup_sessions'), 10);
     add_action('shutdown', array($this, 'save_data'), 20);
     add_action('wp_logout', array($this, 'destroy_session'));
     if (!is_user_logged_in()) {
         add_filter('nonce_user_logged_out', array($this, 'nonce_user_logged_out'));
     }
 }
Пример #21
Показать файл Файл: edd-widget-archives.php Проект: Rexix/edd-widgets-pack
0
 /**
  * Widget
  *
  * @return   void
  * @since    1.0
  */
 function widget($args, $instance)
 {
     if (false == ($cache = get_transient('edd_widgets_archives'))) {
         // get the title and apply filters
         $title = apply_filters('widget_title', $instance['title'] ? $instance['title'] : '');
         // get show count boolean
         $show_count = isset($instance['show_count']) && $instance['show_count'] === 1 ? 1 : 0;
         // start collecting the output
         $out = "";
         // check if there is a title
         if ($title) {
             // add the title to the ouput
             $out .= $args['before_title'] . $title . $args['after_title'];
         }
         $out .= "<ul>\n";
         // add download post type to archives
         add_filter('getarchives_where', array(&$this, 'getarchives_where_filter'), 10, 2);
         add_filter('month_link', array($this, 'month_link'), 10, 3);
         // output the archives
         $out .= wp_get_archives(array('echo' => 0, 'show_post_count' => $show_count));
         // remove filter
         remove_filter('getarchives_where', array(&$this, 'getarchives_where_filter'), 10, 2);
         remove_filter('month_link', array($this, 'month_link'), 10, 3);
         // finish the list
         $out .= "</ul>\n";
         // set the widget's containers
         $cache = $args['before_widget'] . $out . $args['after_widget'];
         // store the result on a temporal transient
         set_transient('edd_widgets_archives', $cache);
     }
     echo $cache;
 }
Пример #22
Показать файл Файл: class-plugin-update-manager.php Проект: heranbuildinggroup/coastbroadwater
0
 /**
  * Setup hooks
  */
 private function setup_hooks()
 {
     // check for updates
     add_filter('pre_set_site_transient_update_plugins', array($this, 'set_updates_available_data'));
     // get correct plugin information (when viewing details)
     add_filter('plugins_api', array($this, 'plugins_api_filter'), 10, 3);
 }
Пример #23
Показать файл Файл: browsers.php Проект: ActiveWebsite/BoojPressPlugins
0
 /**
  * Class contructor
  *
  * @since   0.2
  **/
 public function __construct()
 {
     // activation ##
     register_activation_hook(__FILE__, array($this, 'register_activation_hook'));
     // deactivation ##
     register_deactivation_hook(__FILE__, array($this, 'register_deactivation_hook'));
     // uninstall ##
     // TODO ##
     // load in mobile detect class ##
     if (!class_exists('Mobile_Detect')) {
         include Q_BROWSERS_PATH . '/library/mobile_detect.php';
     }
     // instatiate class ##
     $this->detect = new Mobile_Detect();
     $this->detect->setDetectionType('extended');
     // extended search ##
     // grab user agent ##
     $this->useragent = $_SERVER['HTTP_USER_AGENT'] ? $_SERVER['HTTP_USER_AGENT'] : false;
     if (is_admin()) {
         // text-domain ##
         add_action('plugins_loaded', array($this, 'load_plugin_textdomain'), 1);
         // plugin URL ##
         $this->plugin_URL = WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__));
         $this->plugin_dir_path = plugin_dir_url(__FILE__);
     } else {
         // conditional stylesheets for browser tweaks ##
         add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_conditional'), 10000000);
         // load them late ##
         // browser body_class ##
         add_filter('body_class', array($this, 'body_classes'), 1);
         // comments ##
         add_action('wp_footer', array($this, 'comments'), 1000);
     }
 }
Пример #24
Показать файл Файл: eab-events-limit_capacity.php Проект: nayabbukhari/circulocristiano
0
 private function _add_hooks()
 {
     add_action('eab-settings-after_api_settings', array($this, 'show_settings'));
     add_filter('eab-settings-before_save', array($this, 'save_settings'));
     add_filter('eab-event_meta-event_meta_box-after', array($this, 'add_capacity_meta_box'));
     add_action('eab-event_meta-save_meta', array($this, 'save_capacity_meta'));
     add_action('eab-events-recurrent_event_child-save_meta', array($this, 'save_capacity_meta'));
     add_action('admin_print_scripts-post.php', array($this, 'enqueue_admin_dependencies'));
     add_action('admin_print_scripts-post-new.php', array($this, 'enqueue_admin_dependencies'));
     add_action('eab-javascript-enqueue_scripts', array($this, 'enqueue_public_dependencies'));
     add_filter('eab-rsvps-rsvp_form', array($this, 'handle_rsvp_form'), 10, 2);
     add_filter('eab-event-payment_forms', array($this, 'show_remaining_tickets'), 10, 2);
     add_filter('eab-payment-paypal_tickets-extra_attributes', array($this, 'handle_paypal_tickets'), 10, 3);
     // Front page editor integration
     add_filter('eab-events-fpe-add_meta', array($this, 'add_fpe_meta_box'), 10, 2);
     add_action('eab-events-fpe-enqueue_dependencies', array($this, 'enqueue_fpe_dependencies'), 10, 2);
     add_action('eab-events-fpe-save_meta', array($this, 'save_fpe_meta'), 10, 2);
     // Attendance data juggling
     add_filter('_eab-capacity-internal-attendance', array($this, 'get_remaining_capacity'), 10, 2);
     // MarketPress integration
     add_action('eab-mp-variation-meta', array($this, 'add_mp_inventory'), 10, 5);
     add_action('eab-mp-variation-thrash', array($this, 'thrash_mp_inventory'), 10, 2);
     //Prevent the attendion in the hook rather than just use the form
     add_action('incsub_event_booking', array($this, 'validate_attending_submission'), 10, 3);
 }
Пример #25
Показать файл Файл: wp-oauth-main.php Проект: nikwin333/pcu_project
0
 /**
  * [__construct description]
  */
 function __construct()
 {
     if (!defined("WOABSPATH")) {
         define("WOABSPATH", dirname(__FILE__));
     }
     if (!defined("WOURI")) {
         define("WOURI", plugins_url("/", __FILE__));
     }
     if (function_exists("__autoload")) {
         spl_autoload_register("__autoload");
     }
     spl_autoload_register(array($this, 'autoload'));
     /**
      * Custom auth hook
      * This MUST run before anything just to be safe. 20 seems to be the highest so we will stay close with 
      * priority set to 21
      *
      * @since 3.1.3
      */
     add_filter('determine_current_user', array($this, '_wo_authenicate_bypass'), 10);
     /** 
      * load all dependents
      *
      * @since 1.0.0
      */
     add_action("init", array(__CLASS__, "includes"));
 }
Пример #26
Показать файл Файл: mailhide.php Проект: vpatrinica/jfdesign
0
 function register_filters()
 {
     // add the filters only if mcrypt is loaded
     if ($this->mcrypt_loaded) {
         if ($this->options['use_in_posts']) {
             add_filter('the_content', array(&$this, 'mailhide_emails'), 9000);
         }
         if ($this->options['use_in_comments']) {
             add_filter('comment_text', array(&$this, 'mailhide_emails'), 9000);
         }
         // todo: this seems like it doesn't work: http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content_rss
         //   instead check for is_feed() on 'the_content' filter
         //   the_excerpt_rss filter works fine
         // concern: it seems like the feeds still show the email encoded in CDATA
         if ($this->options['use_in_rss']) {
             add_filter('the_content_rss', array(&$this, 'mailhide_emails'), 9000);
             add_filter('the_excerpt_rss', array(&$this, 'mailhide_emails'), 9000);
             // this one is sometimes used instead
         }
         // todo: atom requires the html to be escaped, rss does not. do so accordingly in the preg_replace_callbacks
         // todo: also be sure to escape replace_link_with
         //       - use htmlentities($var, ENT_QUOTES); for escaping?
         if ($this->options['use_in_rss_comments']) {
             add_filter('comment_text_rss', array(&$this, 'mailhide_emails'), 9000);
         }
     }
 }
Пример #27
Показать файл Файл: template.class.php Проект: QuezonMe/skelet
0
 function __construct($options = array())
 {
     $options = $this->apply_prefix($options);
     $this->options = $options;
     foreach ($options as $tpl) {
         foreach ($tpl as $key => $value) {
             foreach ($value as $is => $cpt) {
                 if ($is == "if") {
                     $this->templates[$key] = array();
                     foreach (array_keys($cpt) as $c) {
                         // array_push(  $this->templates[$key], call_user_func($c));
                         $this->templates[$key][$c] = $c;
                     }
                     foreach ($cpt as $k => $v) {
                         $this->templates[$key][$k] = $v;
                         foreach ($v as $vv) {
                             //  array_push( $this->templates[$key], call_user_func_array($k,array($vv)));
                             array_push($this->templates[$key][$k], $vv);
                         }
                         $this->templates[$key][$k] = array_unique($this->templates[$key][$k]);
                     }
                 }
             }
         }
     }
     add_filter("template_include", array($this, "template_include"));
     add_filter('pre_get_posts', array($this, 'pre_get_posts'));
 }
Пример #28
Показать файл Файл: overrule.recent-posts.php Проект: markoheijnen/life-control
0
 function __construct()
 {
     add_action('in_widget_form', array(&$this, 'extend_recent_posts_form'), 10, 3);
     add_filter('widget_update_callback', array(&$this, 'extend_recent_posts_update'), 10, 4);
     add_filter('widget_title', array(&$this, 'extend_recent_posts_init_query_filter'), 10, 3);
     add_filter('widget_posts_args', array(&$this, 'extend_recent_posts_query'));
 }
Пример #29
Показать файл Файл: class-initial-install.php Проект: TheTypoMaster/evans
0
 /**
  * Constructor function.
  *
  * @access public
  * @since 0.0.0
  * @return void
  */
 function __construct()
 {
     add_action('admin_init', array($this, 'set_home_page'), 105);
     add_action('admin_init', array($this, 'modify_permalinks'), 105);
     add_action('admin_init', array($this, 'create_menus'), 105);
     add_filter('admin_init', array($this, 'update_settings'), 105);
 }
Пример #30
Показать файл Файл: slideshow.php Проект: KurtMakesWeb/CandG
-1
 function __construct()
 {
     global $shortcode_tags;
     $needs_scripts = false;
     // Only if the slideshow shortcode has not already been defined.
     if (!array_key_exists('slideshow', $shortcode_tags)) {
         add_shortcode('slideshow', array($this, 'shortcode_callback'));
         $needs_scripts = true;
     }
     // Only if the gallery shortcode has not been redefined.
     if (isset($shortcode_tags['gallery']) && $shortcode_tags['gallery'] == 'gallery_shortcode') {
         add_filter('post_gallery', array($this, 'post_gallery'), 1002, 2);
         add_filter('jetpack_gallery_types', array($this, 'add_gallery_type'), 10);
         $needs_scripts = true;
     }
     if ($needs_scripts) {
         add_action('wp_enqueue_scripts', array($this, 'maybe_enqueue_scripts'), 1);
     }
     /**
      * For the moment, comment out the setting for v2.8.
      * The remainder should work as it always has.
      * See: https://github.com/Automattic/jetpack/pull/85/files
      */
     // add_action( 'admin_init', array( $this, 'register_settings' ), 5 );
 }