Tag Info

New answers tagged

0

Hey Only Change the code like this function cult_customizer_register( $wp_customize ) { $wp_customize->add_section( 'cult_topic_thumb' , array( 'title' => __( 'Topic of the Week' ), 'priority' => 36, 'description' => 'Allows you to upload an image for your topic of the week section.', ) ); ...


1

I'm not clear on how your code works as-is, as I mentioned in my comment. It looks like you're adding an action to call a function inside the function that you want to call with that action. If nothing outside the function invokes it, it never runs. add_action( 'template_redirect', 'check_breadcrumb_condition' ); function check_breadcrumb_condition(){ ...


0

Use filter content_save_pre exactly like the_content -- the difference is that it operates when a post is saved, rather than displayed. http://codex.wordpress.org/Plugin_API/Filter_Reference/content_save_pre


-1

You could try this: function restricted_access() { if( ! is_user_logged_in() ) { global $wp_query; $wp_query->set_404(); status_header(404); } } add_action( 'wp', 'restricted_access' ); By default, always, if the user is not logged in it will give them the 404 page. The following two functions will keep non-admins out of ...


1

I'm afraid I cannot replicate your problem. I'm uncertain as to why it is going wrong as I cannot see the loop that is being used, but a way that you could probably ensure it works is to adjust your function to accept a $post input: //Social Media function showSocialButtons( $post = null ) { if( ! $post ){ global $post; } //The output ...


4

As @cybmeta already pointed out, you are too early with your removal. So you have to defer the actual removal, for instance like so: add_action( 'after_setup_theme', 'wpdev_170663_remove_parent_theme_stuff', 0 ); function wpdev_170663_remove_parent_theme_stuff() { remove_action( 'after_setup_theme', 'et_pb_setup_theme' ); }


1

The functions.php file of child themes is loaded right before the parent theme functions.php, so when you run remove_action in child theme, the action you are trying to remove doesn't exist beacuse it is added later.


1

Here are two untested ideas: Idea #1: If you want to hook before an instance of the Plugin_Upgrader class is created with: $upgrader = new Plugin_Upgrader( ... ) where the upgrades are activated with: $upgrader->upgrade($plugin); // for a single plugin upgrade $upgrader->bulk_upgrade( $plugins ); // for bulk plugins upgrades then you ...


2

There is nothing technically wrong with that, but backslashes are hard to type on some keyboard layouts. On a German keyboard for example, you have to hit the right AltGr key plus \ at the same time. This is not easy to type (and one of the reasons why I use an English keyboard). Use dots, colons or underscores to namespace your hooks. They are not bound ...


0

Unfortunately it's still not really doable in a clean way. You can see the latest about this here in this trac ticket #16031 I just checked the source and the filter is still basically the same.


0

I am updated the answer, so that it will be helpfull to others as well. (For IE, IIRC it's 512 bytes) Helpful links: http://stackoverflow.com/questions/11121286/404-page-not-showing-up-in-ie9#answer-11133855 http://stackoverflow.com/questions/3970093/include-after-php-404-header-returning-oops-this-link-appears-to-be-broken


1

Your first method doesn't work because you create a new instance of the class and try to remove the action from that new instance. That new instance you created is not the same instance that the action was added to, so it doesn't work. In the second example, you get the original instance that was created by the plugin, so removing the action from that ...


0

On top of my head scheme like this should work: // functions.php function prefix_get_settings() { return array('haha' => 'hehe'); } add_filter( 'prefix_default_settings', 'prefix_get_settings', 9 ); // plugin $default_settings = apply_filters( 'prefix_default_settings', array() );


0

Just to add to Pippin's answer, in my case some content were also being shown in other parts of the single page, e.g. sidebar. Checking just is_single() also triggered the content modification in the other areas. Here's another check so that only the main content will have appended stuff: function yourprefix_add_to_content( $content ) { if( is_single() ...



Top 50 recent answers are included