Post curl function save twice using plugin hook function wordpress

That is normal behaviour. See this question on WordPress Stack Exchange: Plugin Development: WordPress processes twice on post update. How to skip process on the first? answered by @Hameedullah Khan. WordPress call functions hooked to save_post twice because: first time it saves the post revision. second time it saves the actual post. As Hameedulah suggests, … Read more

add query string to all pages after user logged in

add following code to functions.php, add_action(‘wp_head’, ‘your_function’); function your_function(){ if ( is_user_logged_in() ) { $genre_url = add_query_arg(‘aff’, ‘1234567’, get_permalink()); } } Hope this will help you. for more information, is_user_logged_in() How can I include a query string with get_permalink wp_head action hook get_permalink()

Transform .wp-video to the native video player of the browser

I’ve found the right way digging through the WP documentation: https://developer.wordpress.org/reference/hooks/wp_video_shortcode/ This code seems to do the trick: function buildVideoPlayer($output, $attr) { // $output contains the default HTML string, created by the WP core // $attr is an associative array, which contains the parameters // (src, poster, preload, etc.) specified in the shortcode // The … Read more

PHP Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered

Before you can use, those two lines : wp_enqueue_style( ‘wp-auth-check’ ); wp_enqueue_script( ‘wp-auth-check’ ); you should register those assets, inside wp_enqueue_scripts or admin_enqueue_scripts, like the following : function my_assets() { wp_register_style( ‘wp-auth-check’, ‘path/to/style’, $deps = array, $ver = false, $media=”all” ) wp_register_script( ‘wp-auth-check’, ‘path/to/your-script’, $deps = array, $ver = false, $in_footer = false ) } … Read more