本文整理汇总了PHP中remove_all_filters函数的典型用法代码示例。如果您正苦于以下问题:PHP remove_all_filters函数的具体用法?PHP remove_all_filters怎么用?PHP remove_all_filters使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove_all_filters函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: off
protected function off($action, $method = false)
{
if ($method) {
return remove_filter($action, array($this, $method));
}
return remove_all_filters($action);
}
示例2: __construct
function __construct()
{
global $if_utils;
parent::__construct();
// configuration general
global $ilen_seo;
if (is_admin()) {
add_action('admin_enqueue_scripts', array(&$this, 'script_and_style_admin'));
} elseif (!is_admin()) {
if (TRUE) {
global $wp_version;
if ((double) $wp_version >= 4.4) {
add_theme_support("title-tag");
add_filter('pre_get_document_title', array(&$this, 'getRealTitle'));
} else {
if (!has_filter('wp_title', array(&$this, 'getRealTitle'))) {
remove_all_filters('wp_title');
add_filter('wp_title', array(&$this, 'getRealTitle'), 10, 3);
}
}
// add meta tags
add_action('wp_head', array(&$this, 'getMetaTags'), 0);
// remove Wordpress generator (as options)
if (isset($ilen_seo->remove_link_wp_generator) && $ilen_seo->remove_link_wp_generator) {
add_filter('the_generator', array(&$this, 'wp_generator'));
}
// remove canonical links
if (isset($ilen_seo->remove_link_canonical) && $ilen_seo->remove_link_canonical) {
remove_action('wp_head', 'rel_canonical');
}
}
// add scripts & styles
add_action('wp_enqueue_scripts', array(&$this, 'script_and_style_front'));
}
}
示例3: hook_content_filters
function hook_content_filters()
{
/*
* Allow developers to skip running the advanced excerpt filters on certain page types.
* They can do so by using the "Disable On" checkboxes on the options page or
* by passing in an array of page types they'd like to skip
* e.g. array( 'search', 'author' );
* The filter, when implemented, takes precedence over the options page selection.
*
* WordPress default themes (and others) do not use the_excerpt() or get_the_excerpt()
* and instead use the_content(). As such, we also need to hook into the_content().
* To ensure we're not changing the content of single posts / pages we automatically exclude 'singular' page types.
*/
$page_types = $this->get_current_page_types();
$skip_page_types = array_unique(array_merge(array('singular'), $this->options['exclude_pages']));
$skip_page_types = apply_filters('advanced_excerpt_skip_page_types', $skip_page_types);
$page_type_matches = array_intersect($page_types, $skip_page_types);
if (!empty($page_types) && !empty($page_type_matches)) {
return;
}
if (1 == $this->options['the_excerpt']) {
remove_all_filters('get_the_excerpt');
remove_all_filters('the_excerpt');
add_filter('get_the_excerpt', array($this, 'filter_excerpt'));
}
if (1 == $this->options['the_content']) {
add_filter('the_content', array($this, 'filter_content'));
}
}
示例4: widget
/**
* Widget function.
*
* @see WP_Widget
* @access public
* @param array $args
* @param array $instance
* @return void
*/
function widget($args, $instance)
{
if ($this->get_cached_widget($args)) {
return;
}
ob_start();
extract($args);
$title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
$count = $instance['count'];
$category = $instance['category'];
$posts = wp_get_recent_posts(array('post_type' => 'post', 'numberposts' => $count, 'post_status' => 'publish', 'category' => $category), OBJECT);
global $post;
echo $before_widget;
echo '<section class="recent-posts-grid" data-layout="2-2-2-2">';
if ($title) {
echo $before_title . $title . $after_title;
}
foreach ($posts as $post) {
setup_postdata($post);
add_filter('stag_showing_related_posts', '__return_true');
get_template_part('content', get_post_format());
}
echo '</section>';
wp_reset_postdata();
remove_all_filters('stag_showing_related_posts');
echo $after_widget;
$content = ob_get_clean();
echo $content;
$this->cache_widget($args, $content);
}
示例5: test_register
public function test_register()
{
//make sure nobody else interfers with this test
$this->_stop_pretending_addon_hook_time();
remove_all_filters('FHEE__EE_Data_Migration_Manager__get_data_migration_script_folders');
$pretend_addon_name = 'More_Core';
$args = array('dms_paths' => array(EE_TESTS_DIR . 'mocks/core/data_migration_scripts'));
//try registering at wrong time
try {
EE_Register_Data_Migration_Scripts::register($pretend_addon_name, $args);
$this->fail('We should have had a warning saying that we are setting up the ee addon at the wrong time');
} catch (PHPUnit_Framework_Error_Notice $e) {
$this->assertTrue(True);
}
//and check we didn't actually register the DMSs (because we attempted to do so at teh wrong time)
$DMSs_available = EE_Data_Migration_Manager::reset()->get_all_data_migration_scripts_available();
$this->assertArrayNotHasKey('EE_DMS_Core_1_0_0', $DMSs_available);
//ok now pretend we're registering the DMS at the right time
$this->_pretend_addon_hook_time();
EE_Register_Data_Migration_Scripts::register($pretend_addon_name, $args);
$DMSs_available = EE_Data_Migration_Manager::reset()->get_all_data_migration_scripts_available();
$this->assertArrayHasKey('EE_DMS_Core_1_0_0', $DMSs_available);
//now deregister it
EE_Register_Data_Migration_Scripts::deregister($pretend_addon_name);
$DMSs_available = EE_Data_Migration_Manager::reset()->get_all_data_migration_scripts_available();
$this->assertArrayNotHasKey('EE_DMS_Core_1_0_0', $DMSs_available);
$this->_stop_pretending_addon_hook_time();
}
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:28,代码来源:EE_Register_Data_Migration_Scripts_Test.php
示例6: _initHooks
/**
* Срабатывает на событие Init.
* метод приватный, публичный доступ оставлен для корректной работы user_function_call
*/
public function _initHooks()
{
remove_all_filters('woocommerce_cart_link');
//удаляем ссылку на корзину
remove_all_filters('woo_nav_after');
//удаляем сам блок корзины
remove_all_filters('woocommerce_simple_add_to_cart');
remove_action('woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30);
/**
* удаляем станицу корзины из базы
*/
$cart_id = woocommerce_get_page_id('cart');
if ($cart_id) {
wp_delete_post($cart_id);
}
/**
* Меняем работу ссылки добавления в корзину. Теперь она переадресовывает на партнёрку.
*/
add_action('woocommerce_simple_add_to_cart', array($this, 'hook_change_link'), 1, 2);
add_filter('woocommerce_loop_add_to_cart_link', array($this, 'hook_change_link'), 1, 2);
/**
* Подгружаем изображение из мета-поля поста
*/
add_filter('woocommerce_single_product_image_html', array($this, 'hook_woocommerce_single_product_image_html'), 1, 2);
add_action('woocommerce_placeholder_img', array($this, 'hook_woocommerce_placeholder_img'), 11, 1);
}
示例7: tearDown
public function tearDown()
{
parent::tearDown();
remove_all_filters('bbpnns_dry_run');
remove_all_filters('bbpnns_skip_reply_notification');
remove_all_filters('bbpnns_skip_topic_notification');
}
示例8: test_bbp_insert_topic
/**
* @group canonical
* @covers ::bbp_insert_topic
*/
public function test_bbp_insert_topic()
{
$f = $this->factory->forum->create();
$now = time();
$post_date = date('Y-m-d H:i:s', $now - 60 * 60 * 100);
$t = $this->factory->topic->create(array('post_title' => 'Topic 1', 'post_content' => 'Content for Topic 1', 'post_parent' => $f, 'post_date' => $post_date, 'topic_meta' => array('forum_id' => $f)));
$r = $this->factory->reply->create(array('post_parent' => $t, 'post_date' => $post_date, 'reply_meta' => array('forum_id' => $f, 'topic_id' => $t)));
// Get the topic.
$topic = bbp_get_topic($t);
remove_all_filters('bbp_get_topic_content');
// Topic post.
$this->assertSame('Topic 1', bbp_get_topic_title($t));
$this->assertSame('Content for Topic 1', bbp_get_topic_content($t));
$this->assertSame('publish', bbp_get_topic_status($t));
$this->assertSame($f, wp_get_post_parent_id($t));
$this->assertEquals('http://' . WP_TESTS_DOMAIN . '/?topic=' . $topic->post_name, $topic->guid);
// Topic meta.
$this->assertSame($f, bbp_get_topic_forum_id($t));
$this->assertSame(1, bbp_get_topic_reply_count($t, true));
$this->assertSame(0, bbp_get_topic_reply_count_hidden($t, true));
$this->assertSame(1, bbp_get_topic_voice_count($t, true));
$this->assertSame($r, bbp_get_topic_last_reply_id($t));
$this->assertSame($r, bbp_get_topic_last_active_id($t));
$this->assertSame('4 days, 4 hours ago', bbp_get_topic_last_active_time($t));
}
示例9: converio_image_slider
function converio_image_slider($atts, $content = '')
{
if (isset($atts) && !empty($atts)) {
array_walk($atts, 'converio_arrangement_shortcode_arr_value');
}
extract(shortcode_atts(array('type' => '', 'translate_next' => '', 'translate_previous' => ''), $atts));
remove_all_filters('converio_filters_image_slider', 10);
if ($type == '2') {
add_filter('converio_filters_image_slider', 'converio_filter_image_slider_two', 10);
$output = '<div class="slider-image">';
$output .= '<div class="container">';
$output .= '<p class="number"><span></span>/<b></b></p>';
$output .= '<ul id="slides">';
$output .= '<a class="slidesjs-previous slidesjs-navigation" href="#" title="Previous">' . $translate_next . '</a> <a class="slidesjs-next slidesjs-navigation" href="#" title="Next">' . $translate_previous . '</a>';
$output .= do_shortcode($content);
$output .= '</ul>';
$output .= '</div>';
$output .= '</div>';
} else {
add_filter('converio_filters_image_slider', 'converio_filter_image_slider_one', 10);
$output = '<section class="slider3">';
$output .= '<div class="slider">';
$output .= do_shortcode($content);
$output .= '</div>';
$output .= '</section>';
}
return $output;
}
示例10: test_get_groups_none_registered
/**
* Test /settings without valid permissions/creds.
*
* @since 2.7.0
* @covers WC_Rest_Settings_Controller::get_items
*/
public function test_get_groups_none_registered()
{
wp_set_current_user($this->user);
remove_all_filters('woocommerce_settings_groups');
$response = $this->server->dispatch(new WP_REST_Request('GET', '/wc/v1/settings'));
$this->assertEquals(500, $response->get_status());
WC_Helper_Settings::register();
}
示例11: ac_user_bio_save_filters
function ac_user_bio_save_filters()
{
// Contributor level user or higher required
if (!current_user_can('edit_posts')) {
return;
}
remove_all_filters('pre_user_description');
}
示例12: wprcd_admin_init
function wprcd_admin_init()
{
if (!is_admin() || basename($_SERVER['PHP_SELF']) != 'edit-tags.php' || $_REQUEST['taxonomy'] != 'category') {
return;
}
remove_all_filters('pre_term_description');
WP_Rich_Category_Description::init();
}
示例13: converio_team_slider
function converio_team_slider($atts, $content)
{
add_filter('converio_filters_columns_class', 'converio_filter_team_slider_class', 10);
add_filter('converio_filters_team_member', 'converio_filter_team_slider_member', 10);
$output = '<div class="slider-box"><div>' . do_shortcode($content) . '</div></div>';
remove_all_filters('converio_filters_team_member');
return $output;
}
示例14: setUp
function setUp()
{
parent::setUp();
remove_all_filters('session_token_manager');
$user_id = $this->factory->user->create();
$this->manager = WP_Session_Tokens::get_instance($user_id);
$this->assertInstanceOf('WP_Session_Tokens', $this->manager);
$this->assertInstanceOf('WP_User_Meta_Session_Tokens', $this->manager);
}
示例15: setUp
/**
* @inheritDoc
*/
function setUp()
{
parent::setUp();
/* Remove temporary tables which causes problems with GF */
remove_all_filters('query', 10);
/* Ensure the database is correctly set up */
@GFForms::setup_database();
$this->factory = new GF_UnitTest_Factory($this);
}