Tag Info

New answers tagged

0

I see a problem in the register_taxonomy function. The second argument that you are using is: array ( 0 => 'frontiles' ) But it should be: array ( 'frontiles' ) Or, as you are passing only one CPT, it could be also a string: 'frontiles' Also, you are executing insert_term() in every page load but in your code I see that always is the same term ...


0

We can add https in very simple way.... No need to had code all these in any hook.... Log in to wordpress admin Go to Settings > General Find WordPress Address (URL) and Replace HTTP with HTTPS Find Site Address (URL) and Replace HTTP with HTTPS Click Save Changes Edit .htaccess file and add bellow code RewriteEngine On RewriteCond %{HTTPS} off [OR] ...


0

Also, you can write a function in the functions.php file and call that function via the widget. Functions.php: function myFunction() { //do something here } add_shortcode('wp_my_function', 'myFunction'); //Allow write shortcode in widgets add_filter('widget_text', 'do_shortcode'); In the Widget: Use the text widget, write in the shortcode: ...


0

Yes by using widget_text inject content into the widget area Add the following code into your function.php file function widget_content( $content ) { // add $content as you want return $content; } add_filter( 'widget_text', 'widget_content', 99 );


0

Yes, there is number of hooks in generic low level update_metadata() function. Limited to the post meta you would probably want to use update_postmeta or updated_postmeta.


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

If you need to change the template used, you can use the template_include filter (change "itermediate-template.php" and "page.php" with correct file names of your template files): add_filter( 'template_include', 'cyb_exclude_template_for_editors', 99 ); function cyb_exclude_template_for_editors( $template ) { $user = wp_get_current_user(); if( ...


1

When it comes to the oop way of doing things you need more than just the class, you also need to instantiate it as an object at some point if you want the action to fire. class myClass{ function __construct(){ add_action( 'init', array( $this, 'someFun' ) ); } function someFun(){ include( 'my-script.php' ); } } ...


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

I was able to resolve both defaulting to the Visual editor and hiding the tabs with the following code. Dumped the following in plugin file: add_filter( 'wp_default_editor', array($this, 'default_editor') ); Hide the tabs with this javascript: $('.wp-editor-tabs').remove(); Or hide it with CSS: .wp-editor-tabs{display:none;}


0

I am not sure how are you ending up with these results. The earliest hook it should work at is roughly admin_init. Anything as early as load process (wp-settings.php, including function.php, plugins_loaded, and even init) should (and does in my installation) produce fatal error, because function definitions hadn't loaded yet. The definition for these ...


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.


1

The hooks are fine for change the login style. I think is better idea to identifier, why is the load so much slow. I have a lot of change for different installs and no problems with this hooks. But I see also often a lot of loads of unused source. I change the login style with this class: ...


0

You can with filter. On your plugin : $value = 0; $value = apply_filter('get_value_from_function', $value); Then on functions.php add_filter('get_value_from_function', 'my_special_value_treatment', 10, 1); function my_special_value_treatment ($value){ return 1; }


2

For that I would suggest to use 'init' hook. According to codex This runs after WordPress has finished loading but before any headers are sent For more details visit codex explantion and examples for this hook; Codex link. You can find answer to similar question over here; How to set custom cookies before output



Top 50 recent answers are included