How can i call a custom method on submission of a custom plugin post type?

save_post is an action triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email. The data for the post is stored in $_POST, $_GET or the global $post_data, depending on how the post was edited. For example, quick edits use $_POST. … Read more

Custom Sanitation Function Triggering an Alert in Customizer?

Ok i solved it looks like that getimagesize will generate error/notice if image is not found, so alert box will fire… This is straight from PHP docs: If accessing the filename image is impossible getimagesize() will generate an error of level E_WARNING. On read error, getimagesize() will generate an error of level E_NOTICE. Here is … Read more

custom-background callback breaks media uploader

Long shot, but if you happen to not follow the recommended format and include the number sign with the HEX code when you define the default colour in your theme support, like this: if (function_exists(‘add_theme_support’)) { $defaults = array(‘default-color’ => ‘#666’); add_theme_support( ‘custom-background’, $defaults ); } Then, with your code above, you will end up … Read more

Calling PHP function doesn’t work in index.php

I think you’re misunderstanding the function get_page_template_slug When you call $template = get_page_template_slug( $post_id ); it won’t return index.php if you are using the default theme template. It only works when viewing Pages and will either return the slug of the Custom Page Template assigned to that Page or an empty string otherwise. So if … Read more

Debug in WP backend

The warning states the issue is coming from custom code as in core WP no function as add_role_caps_to_job_agent exists. Try searching for add_role_caps_to_job_agent in wp-content, to see how this function is getting called and fix or uncomment the call. The other two notices will disappear once the first notice is solved as WP is trying … Read more