Created
January 8, 2016 21:47
-
-
Save rfmeier/01e6e8f72483afbe2b4f to your computer and use it in GitHub Desktop.
Register a sanitization callback for the custom setting
This file contains hidden or 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
| <?php | |
| /** | |
| * Register a sanitization callback for the custom setting. | |
| */ | |
| add_action( 'genesis_settings_sanitizer_init', 'cpt_as_genesis_sanitize_settings' ); | |
| /** | |
| * Callback for Genesis 'genesis_settings_sanitizer_init' action. | |
| * | |
| * Add the settings to the filter. | |
| * | |
| * @global $_genesis_admin_cpt_archives_testimony Genesis_Admin_CPT_Archive_Settings object for the 'testimony' post type. | |
| * | |
| * @uses genesis_add_option_filter | |
| * | |
| * @since 0.0.1 | |
| * | |
| * @return void | |
| */ | |
| function cpt_as_genesis_sanitize_settings() { | |
| global $_genesis_admin_cpt_archives_testimony; | |
| genesis_add_option_filter( | |
| 'absint', | |
| $_genesis_admin_cpt_archives_testimony->settings_field, | |
| array( | |
| 'posts_per_page', | |
| ) | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment