chose category in plugin

IDs are your friends. Get the category list using get_category (i’m assuming we are talking about the in-built WordPress “category” taxonomy, which slug is category). $categories = get_categories( array( ‘hide_empty’ => false // This is optional ) ); Use the obtained category list in the output of your <select> field: <?php // get $selected_term_id from … Read more

admin quick edit existing column in posts

Here is my meccano made of pieces found somewhere around. This code is from one of my unfinished and abandoned projects, but it worked (to my personal memory). Note that I’ve prefixed the meta name with the underscore (_tie_post_views) to avoid its appearance in Custom Fields metabox on Post Edit page. You’ll be forced to … Read more

Response from Php File to Ajax is not getting sent

Issue Solved I was missing a closing brace for data… jQuery(document).ready(function($){ $(“#login_otp_btn”).click(function(event){ val(); event.preventDefault(); jQuery.ajax({ url: wpac_ajax_url.ajax_url, type:’POST’, data :{ dataType:’JSON’, action : ‘login_ajax_callback’, login : $(“#login_mobile”).val(), } success:function(response){ console.log(“url wpac ” + wpac_ajax_url.ajax_url); if(response !== “”){ response = JSON.parse( response ); console.log(response); }else{ console.log(“Response is empty”); } }, }); $(“#login_otp_field”).show(); }) });

Simple method to generate posts from files

One way is to have the posts in a Json format, and use wp_insert_post(); to automatically create the posts. documentation: https://developer.wordpress.org/reference/functions/wp_insert_post/

Hide woocommerce login form

You miss the required remove_action() parameter — the name of the function to remove. See the Code Reference. <?php add_action( ‘woocommerce_login_form’, ‘woocom_extra_register_fields’ ); function woocom_extra_register_fields () { if ( is_page( ‘installation’ ) ) { remove_action( ‘woocommerce_login_form’, ‘woocom_extra_register_fields’, 10 ); // note this } } I suspect the code you’ve posted is not complete, so, adding … Read more