This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Repeatable Custom Fields in a Metabox | |
* Author: Sanjaya (Fendora Bhai) | |
* | |
* From a bespoke system, so currently not modular - will fix soon | |
* Note that this particular metadata is saved as one multidimensional array (serialized) | |
*/ | |
/*function hhs_get_sample_options() { | |
$options = array ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mandatory_excerpt($data) { | |
//for multiple custom post type just add && 'custom-post-type-slug' != $data['post_type'] | |
if ( 'custom-post-type-slug' != $data['post_type'] ) { | |
} else { | |
$excerpt = $data['post_excerpt']; | |
if (empty($excerpt)) { | |
if ($data['post_status'] === 'publish') { | |
add_filter('redirect_post_location', 'excerpt_error_message_redirect', '99'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mandatory_excerpt($data) { | |
//for multiple custom post type just add && 'custom-post-type-slug' != $data['post_type'] | |
if ( 'custom-post-type-slug' != $data['post_type'] ) { | |
} else { | |
$excerpt = $data['post_excerpt']; | |
if (empty($excerpt)) { | |
if ($data['post_status'] === 'publish') { | |
add_filter('redirect_post_location', 'excerpt_error_message_redirect', '99'); | |
} |