How to write different events from different functions in my file to a log file in WordPress

If you set the WP_DEBUG* constants in your wp-config.php file: define( ‘WP_DEBUG’, true ); define( ‘WP_DEBUG_LOG’, true ); define( ‘WP_DEBUG_DISPLAY’, false ); // prevents debugging messages from appearing in the browser …then you should be able to use error_log() in your code, and your debugging messages will be saved in wp-content/debug.log. (You’ll probably have to … Read more

Create survey that redirects to sidebar menu customized to answers

The wordpress plugin archive offers a lot of options for this kind of topic. You should read the explanations and documentation of the plugin. Here are the plugins I would recommend to you; https://wordpress.org/plugins/formidable/ https://wordpress.org/plugins/quiz-master-next/ https://wordpress.org/plugins/wp-polls/ https://wordpress.org/plugins/social-polls-by-opinionstage/ https://wordpress.org/plugins/yop-poll/

Change Woo Custom Endpoint Titles from a Plugin

public function start(){ add_action(‘init’, array($this, ‘knp_supplier_endpoint’)); //Add endpoint urls add_action(‘woocommerce_account_product-submissions_endpoint’, array($this, ‘knp_product_submissions_content’)); add_action(‘woocommerce_account_submission-form_endpoint’, array($this, ‘knp_submission_form_content’)); add_action(‘woocommerce_account_review_endpoint’, array($this, ‘knp_review_content’)); add_action(‘woocommerce_account_delete_endpoint’, array($this, ‘knp_delete_content’)); //Answer using this filter add_filter( ‘the_title’, array($this, ‘knpv_title_filter’), 10, 2); } public function knpv_title_filter($title, $id = null){ global $wp_query; if (in_the_loop() && array_key_exists(‘submission-form’, $wp_query->query)) { $title=”Create / Edit Submission”; } elseif (in_the_loop() && array_key_exists(‘product-submissions’, … Read more

register dependency css and js inside a plugin class

You’re using the incorrect hook. The only hook is wp_enqueue_scripts (plural). You use wp_enqueue_style() and wp_register_script() etc. on that hook, but the hook is always the same. So this: add_action(‘wp_enqueue_script’ , array( $this, ‘initBootstrap’ )); add_action(‘wp_enqueue_style’ , array( $this, ‘initBootstrap’ )); add_action(‘wp_register_script’ , array( $this, ‘initParallax’ )); add_action(‘wp_register_style’ , array( $this, ‘initParallax’ )); add_action(‘wp_register_script’ , … Read more