170 reputation
116
bio website
location
age
visits member for 3 years, 5 months
seen Jun 6 at 19:44

Apr
23
comment save_post action to include wp_insert_post_data filter, gathering meta field info & prevent infinite loop
In this case I think it probably is, I've put the question to the plugin authors as well to see if they can comment. Normally accessing types CPTs and meta boxes work just fine within a loop, so it didn't occur to me that it might not be doing things as expected in this instance.
Apr
22
comment save_post action to include wp_insert_post_data filter, gathering meta field info & prevent infinite loop
I've upvoted your contribution, as it was helpful. Im not sure if it would work for others or not.
Apr
22
comment save_post action to include wp_insert_post_data filter, gathering meta field info & prevent infinite loop
I keep trying to access the meta values using updated_post_meta and I'm not getting anywhere. If I run a save on the post in question, I only get one result, and I get strange numbers for the values of meta_key, meta_id and object_id. The meta_value returns _edit_lock. I dont this this action is running late enough. It may have to do with the fields being added by the types plugin, though in other instances I've been able to access them through the key name, so Im not sure what the difference. I've returned to my original approach using wp_update_post.
Apr
21
comment save_post action to include wp_insert_post_data filter, gathering meta field info & prevent infinite loop
Erm, this produces a bunch of notices - first missing semicolon wp_update_post( $post, true )
Apr
21
comment save_post action to include wp_insert_post_data filter, gathering meta field info & prevent infinite loop
I think you've missed my point. Im after the value of $show_time = types_render_field( "show-time", array("post_id"=>"$child_ID", "raw"=>"true") ); At the point of save_post, this value hasn't been set in the database, yet I want to add it to the post title. Take a read of wordpress.stackexchange.com/a/54713/13551. He's asking the same kind of question. Im just having trouble implementing it.
Apr
14
comment Prevent wp_debug from polluting ajax within plugin
$wpdb->esc_like($title) works, though the headers sent warning returns, and ob_buffer still has noting to delete. - squirlie problem this is. I'll workin your more robust suggestions and hopeful in that process I sort the issue.
Apr
14
comment Prevent wp_debug from polluting ajax within plugin
Well spotted! However, this leads to PHP Strict Standards: Non-static method wpdb::esc_like() should not be called statically in . . . . 8{
Apr
14
comment Prevent wp_debug from polluting ajax within plugin
given what Im seeing - I'm going to work in your second approach. I'd like this to be as robust as possible without making demands on the environment. I can see having to move hosts for example in a year, and I'd hate to overcomplicate this, in case its not me who does it. It will take a few days before I can get to this but will come back with comments. Many thanks again for sharing your approach - very helpful indeed.
Apr
14
comment Prevent wp_debug from polluting ajax within plugin
Also, regardless of the use or warnings related to ob_clean, I'm still seeing the notices make their way through to the response, so a check won't affect the results. This would seem evidence that ob_clean, isn't actually doing what the codex suggest. joson_encode however does just fine, when wp_debug is disabled. So this leads me to think that the notices are causing the issue, not the construction of json itself. a quandry - I will double check the json results to be sure.
Apr
14
comment Prevent wp_debug from polluting ajax within plugin
Thanks for the detailed write up! I will digest, but regarding the headers, I initially had them where you suggested, but received headers already sent warnings. I moved it up to the position until they disappeared.
Apr
14
comment Prevent wp_debug from polluting ajax within plugin
There deprecated notices for like_escape which is used in wp-includes/functions.php, so nothing I have control over as Im currently running the latest version of WP. @TheDeadMedic following guidance from codex.wordpress.org/AJAX_in_Plugins, they sugest under the dubuggin section that ob_clean() will clear any notices before sending them through as part of the json output - wreaking havoc. -- I'll up the post with their recommendations.
Apr
14
comment Prevent wp_debug from polluting ajax within plugin
@TheDeadMedic your advice is good and I've taken a revision. But the result is the same. @czerspalace with this refactoring the result is the same as your suggestion no? Yes a better block of code, but still: PHP Notice: ob_clean(): failed to delete buffer. No buffer to delete in ....
Nov
8
comment dynamically update permalink and title with the values of custom fileds
I've not been able to test this yet, but am accepting this as is because the WP documentation supports what you've said. Thanks!
Nov
5
comment dynamically update permalink and title with the values of custom fileds
I've updated the title to better reflect what Im after. I think hiding the title field is nessicary to prevent the user from getting the impression they can efect changes here. Ultimatly I would like to pull custom field data but wp_insert_post_data is exactly what I need to acomplish this. One question - what happens if two posts have exactly the same $data['post_name'] ?
Jul
31
comment admin_notices after register_uninstall / deactivate_hook
@kaiser Yes I've seen all the docs and that answer - but none allow a notice to the admin due (i believe) to the page refresh after they occur. Will update question in a moment.
Jul
31
comment Uninstall, Activate, Deactivate a plugin: typical features & how-to
Think this should do it: register_activation_hook( __FILE__, function() { add_option('Activated_Plugin','Plugin-Slug'); }); add_action('admin_init', 'load_plugin'); function load_plugin() { if ( ! current_user_can( 'activate_plugins' ) ) return; if(is_admin()&&get_option('Activated_Plugin')=='Plugin-Slug') { delete_option('Activated_Plugin'); add_action( 'admin_notices', 't5_check_admin_notices', 0 ); } }
Jul
31
comment Uninstall, Activate, Deactivate a plugin: typical features & how-to
Actually just stumbled on the easy way: stackoverflow.com/a/13927297/362445
Jul
31
comment Uninstall, Activate, Deactivate a plugin: typical features & how-to
I see - but if the plugin is activated outside the plugin page (say as part of a theme dependency) then your checks will get skipped no? So I tried moving add_action( 'admin_notices', 't5_check_admin_notices', 0 ); into an activation hook and the plugin activates without performing the checks . . .
Jul
31
comment Uninstall, Activate, Deactivate a plugin: typical features & how-to
Touch confused, so basically there isn't a call to register_activation_hook here -- why not use it? Also will this fire before or after register_activation_hook and will register_activation_hook fire even if the above doesn't pass?
Jun
26
comment WordPress MultiSite Active Directory integration and site privacy
How did you get on with this? Im researching a similar implementation for a school.