| @@ 181-190 (lines=10) @@ | ||
| 178 | /** |
|
| 179 | * Should this Custom Post Type be made available? |
|
| 180 | */ |
|
| 181 | function site_supports_custom_post_type() { |
|
| 182 | // If the current theme requests it. |
|
| 183 | if ( current_theme_supports( self::CUSTOM_POST_TYPE ) || get_option( self::OPTION_NAME, '0' ) ) { |
|
| 184 | return true; |
|
| 185 | } |
|
| 186 | ||
| 187 | // Otherwise, say no unless something wants to filter us to say yes. |
|
| 188 | /** This action is documented in modules/custom-post-types/nova.php */ |
|
| 189 | return (bool) apply_filters( 'jetpack_enable_cpt', false, self::CUSTOM_POST_TYPE ); |
|
| 190 | } |
|
| 191 | ||
| 192 | /** |
|
| 193 | * Add to REST API post type whitelist |
|
| @@ 152-161 (lines=10) @@ | ||
| 149 | /** |
|
| 150 | * Should this Custom Post Type be made available? |
|
| 151 | */ |
|
| 152 | function site_supports_custom_post_type() { |
|
| 153 | // If the current theme requests it. |
|
| 154 | if ( current_theme_supports( self::CUSTOM_POST_TYPE ) || get_option( self::OPTION_NAME, '0' ) ) { |
|
| 155 | return true; |
|
| 156 | } |
|
| 157 | ||
| 158 | // Otherwise, say no unless something wants to filter us to say yes. |
|
| 159 | /** This action is documented in modules/custom-post-types/nova.php */ |
|
| 160 | return (bool) apply_filters( 'jetpack_enable_cpt', false, self::CUSTOM_POST_TYPE ); |
|
| 161 | } |
|
| 162 | ||
| 163 | /* |
|
| 164 | * Flush permalinks when CPT option is turned on/off |
|