check, if any “add_action” function contains string XXXXXXXXX
I’ve managed to solve that: I am filtering out the whole HTML output before it is actually outputed.
I’ve managed to solve that: I am filtering out the whole HTML output before it is actually outputed.
Custom button on admin page doesn’t trigger click event
… (although I found it strange that I didn’t need to write activation or deactivation code…). You don’t need activation of deactivation code unless there is something you need to do on activation or deactivation. I tested my plugin by using a simple echo ‘fd is running’; which strangely shows up at the top of … Read more
You could do something like this: function wpufe_auto_login_new_user( $user_id ) { if ( is_page( ‘Page Title’ ){ wp_set_current_user( $user_id ); wp_set_auth_cookie( $user_id, false, is_ssl() ); } } Yes. I would use wp_redirect(). If your are redirecting from some other page to the login page. But I am unsure what you want to redirect to or … Read more
register_taxonomy( ‘taxonomy’, array( ‘post’, ‘coupons’ ), $args ); https://generatewp.com/taxonomy/ can help you. // new code taxonomias function clrp_taxonomy_post(){ global $wpdb, $app_abbr; //need $wpdb!! if(get_option($app_abbr.’_coupon_store_tax_permalink’)) $store_tax_base_url = get_option($app_abbr.’_coupon_store_tax_permalink’); else $store_tax_base_url=”store”; register_taxonomy( APP_TAX_STORE, // taxonomy stores array( APP_POST_TYPE_POST, APP_POST_TYPE ), // type POST + APP_POST_TYPE array( ‘hierarchical’ => true, ‘labels’ => array( ‘name’ => __( ‘Stores’, ‘appthemes’), … Read more
If all you are doing is setting a cookie on a page then why the complexity? Check this out for a simple answer http://www.w3schools.com/php/func_http_setcookie.asp My only thought is that you are then trying to redirect them back to WordPress and if so you may wish to check this Setting custom cookies in WordPress I’d say … Read more
That depends on whether your plugin is written in a procedural or object oriented style. register_activation_hook is what you want. https://codex.wordpress.org/Function_Reference/register_activation_hook How exactly you incorporate it depends on your plugin coding style. Examples listed in the Codex show multiple approaches. Procedural example: If you have a function called myplugin_activate() in the main plugin file at … Read more
I hope I understood you correctly as your question is a bit scrambled BACKGROUND Functions, just like your car, are pretty useless objects until they are put to use of some kind. Simply being defined in functions.php or in a plugin makes functions as useful as a car parked in a garage, it is there, … Read more
By default this is not possible. There are workarounds if you do it the OOP way. You could create a class to store the values you want to use later. Example: /** * Stores a value and calls any existing function with this value. */ class WPSE_Filter_Storage { /** * Filled by __construct(). Used by … Read more
You can try with using pre_get_posts add_action(‘pre_get_posts’,’alter_query’); function alter_query($query) { //gets the global query var object global $wp_query; //gets the front page id set in options $front_page_id = get_option(‘page_on_front’); if ( ‘page’ != get_option(‘show_on_front’) || $front_page_id != $wp_query->query_vars[‘page_id’] ) return; if ( !$query->is_main_query() ) return; $query-> set(‘post_type’ ,’page’); $query-> set(‘post__in’ ,array( $front_page_id , [YOUR SECOND … Read more