Saving category as insert post
The array for post_category needs to be an array of integers, not a string, and that’s what you are getting from the $_POST[‘cat’] the way you have it written. Change the value in the option to the category id instead.
The array for post_category needs to be an array of integers, not a string, and that’s what you are getting from the $_POST[‘cat’] the way you have it written. Change the value in the option to the category id instead.
Undefined index notice when using the $args parameter in add_settings_field()
Dynamic Post Type Variable echo as string?
Those are name of callback function which would be enabled for custom header. For example: if custom_function is assigned to ‘wp-head-callback’ then, there would be an action call like: add_action(‘wp_head’,’custom_function’) custom_function is the function you need to define.
To ajax this function you have hook it, so your function will be like this : function write_cat_list($cat){ $cats = get_categories(‘hide_empty=0’); if($cats) : $tinyMCE_list = array(); foreach ($cats as $cat) : $tinyMCE_list[] = array( ‘text’ => $cat->name , ‘value’ => $cat->term_id ); //write_cat_list($cat->term_id); endforeach; $jscode = json_encode($tinyMCE_list); //to convert from array to opject echo $jscode; … Read more
This isn’t the way shortcode works. When you use shortcode it isn’t processed in the editor, it is processed when someone views the page. It sounds like what you really want is to add a custom button to TinyMCE and from there the user can select a table template (or whatever) that gets insert into … Read more
You can use get_the_ID(); function in place of $post_id= ‘your post id’ so that you don’t have to place the post id manually every time. The Function automatically gets the id of the post/page
You could insert a $wpdb->show_errors(); to output the errors in your query. Also you need to input that sql into dbDelta($sql) did you miss that?
Use Advanced Custom Fields. I despise using plugins when I can do something myself but ACF has become indispensable for solving code nightmares like this.
How to add a code for lastpostdate after/inside a specific menu link?