acf_pro::invalid_license_redirect_notice
Adds a notice if a user has attempted to edit an ACF item without a valid license.
Method of the class: acf_pro{}
No Hooks.
Returns
null. Nothing (null).
Usage
$acf_pro = new acf_pro(); $acf_pro->invalid_license_redirect_notice( $post_type );
- $post_type(string) (required)
- The post type being edited.
Changelog
| Since 6.2.8 | Introduced. |
acf_pro::invalid_license_redirect_notice() acf pro::invalid license redirect notice code ACF 6.8.8
public function invalid_license_redirect_notice( string $post_type ) {
if ( ! acf_request_arg( 'acf_invalid_license', false ) ) {
return;
}
if ( 'acf-field-group' === $post_type ) {
acf_add_admin_notice( __( 'A valid license is required to edit field groups assigned to a block.', 'acf' ), 'error' );
} elseif ( 'acf-ui-options-page' === $post_type ) {
acf_add_admin_notice( __( 'A valid license is required to edit options pages.', 'acf' ), 'error' );
}
}