Hot answers tagged

2

I don't think this should happen by default. From quick look through the code the only case in which update call should affect meta is if you provide meta_input in arguments to apply. As per comment the case might be that you are trying to interact with third party CPT and its code doesn't handle situation well. Note that "own file" doesn't matter much ...


2

Post type names cannot contain capital letters. So behind the scenes, your CPT is probably called projectscpt rather than ProjectsCPT - hence it not matching the value in your array.


2

After Milo's tutorship: I recommend first reading how to use AJAX in Plugins properly. – Milo yesterday and reading another questions on wp.stack, my problem was solved) Here is an examples of code from my rewritten files 1)get_state.php: ad add_action( 'wp_ajax_ajax_object', 'ajax_handler' ); add_action( 'wp_ajax_nopriv_ajax_object', ...


2

You could filter the include paths returned by get_included_files by removing any files from the list that are not in your theme (and/or child theme) directory: function get_theme_includes() { $includedfiles = get_included_files(); // normalize theme paths for matching $styledir = str_replace("\\","/",get_stylesheet_directory()); ...


1

Based on the source code of wp_publish_post(), you could update the post status without touching meta data and, at the same time, without losing post transition actions (you are missing them in your code) with something like this: global $wpdb; // Unkown $get_directories, you have not set it // in your sample code, I assume it is correct $directories = ...


1

register_activation_hook() only attaches a function to run on activation of your plugin, not on updating. See the docs for full details, particularly this part: 3.1 : This hook is now fired only when the user activates the plugin and not when an automatic plugin update occurs (#14915). Of course, you could force your hook to run by deactivating and ...


1

I am not sure I follow your question, title seems different from question itself. You seem to want to get rid of index.php in URL? It's hard to say confidently from outside, but it looks like PATHINFO permalink. If that's the case you would need to change your WP permalink configuration to more common "pretty" one. Doesn't have anything to do with CPT's ...



Only top voted, non community-wiki answers of a minimum length are eligible