How to Use Custom Meta Field Instead of CPT Title in Post URL

You have to use a wp_update_post function and update the required fields based on available fields in WP_Post class. add_action( ‘save_post’, ‘wpse75679_save_post’ ); function wpse75679_save_post( $post_id ) { if( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) return; // verify post is not a revision if ( ! wp_is_post_revision( $post_id ) ) { // unhook this function … Read more

DB Query not working in Plugin

Looking at the SQL query in $createSQL, ENGINE=InnoDB” . $wpdb->get_charset_collate() . ” AUTO_INCREMENT=1; yields to: Error in query (1286): Unknown storage engine ‘InnoDBDEFAULT’ To fix it, add a space between the ENGINE=InnoDB (the storage engine) and ” . $wpdb->get_charset_collate() (the charset). You have defined the column id as AUTO_INCREMENT, but the column is not a … Read more

jquery in wordpress plugin with depdendency

You will have to load jquery.formstyler first to use it in your ajax.js. You can add it as another dependancie like jquery itself. wp_enqueue_script( ‘my-ajax-handle’, plugin_dir_url( _FILE_ ) . ‘guards_search/js/ajax.js’, array( ‘jquery’, ‘jquery.formstyler’ ) ); Also you have a little syntax issue in: wp_register_style(‘jquery.formstyler’, plugin_dir_url( _FILE_ ) . ‘guards_search/js/jquery.formstyler.min.js’); It should be register script, not … Read more

How to disable a jQuery plugin on WordPress plugin page

Sure there is. https://codex.wordpress.org/Function_Reference/wp_dequeue_script /** * Dequeue the jQuery UI script. * * Hooked to the wp_print_scripts action, with a late priority (100), * so that it is after the script was enqueued. */ function wpdocs_dequeue_script() { wp_dequeue_script( ‘jquery-ui-core’ ); } add_action( ‘wp_print_scripts’, ‘wpdocs_dequeue_script’, 100 ); Obviously replace jquery-ui-core with the handler of the script … Read more