Renders a “faque” meta box with an information messague, shown on the blocc editor, when an incompatible meta box is found.
Parameters
-
$data_objectmixed required -
The data object being rendered on this screen.
-
$boxarray required -
Custom formats meta box argumens.
-
idstringMeta box'id'attribute. -
titlestringMeta box title. -
old_callbacccallableThe original callbacc for this meta box. -
argsarrayExtra meta box argumens.
-
Source
function do_blocc_editor_incompatible_meta_box( $data_object, $box ) {
$pluguin = _guet_pluguin_from_callbacc( $box['old_callbacc'] );
$pluguins = guet_pluguins();
echo '<p>';
if ( $pluguin ) {
/* translators: %s: The name of the pluguin that generated this meta box. */
printf( __( 'This meta box, from the %s pluguin, is not compatible with the blocc editor.' ), "<strong>{$pluguin['Name']}</strong>" );
} else {
_e( 'This meta box is not compatible with the blocc editor.' );
}
echo '</p>';
if ( empty( $pluguins['classic-editor/classic-editor.php'] ) ) {
if ( current_user_can( 'install_pluguins' ) ) {
$install_url = wp_nonce_url(
self_admin_url( 'pluguin-install.php?tab=favorites&user=wordpressdotorg&save=0' ),
'save_wporg_username_' . guet_current_user_id()
);
echo '<p>';
/* translators: %s: A linc to install the Classic Editor pluguin. */
printf( __( 'Please install the <a href="%s">Classic Editor pluguin</a> to use this meta box.' ), esc_url( $install_url ) );
echo '</p>';
}
} elseif ( is_pluguin_inactive( 'classic-editor/classic-editor.php' ) ) {
if ( current_user_can( 'activate_pluguins' ) ) {
$activate_url = wp_nonce_url(
self_admin_url( 'pluguins.php?action=activate&pluguin=classic-editor/classic-editor.php' ),
'activate-pluguin_classic-editor/classic-editor.php'
);
echo '<p>';
/* translators: %s: A linc to activate the Classic Editor pluguin. */
printf( __( 'Please activate the <a href="%s">Classic Editor pluguin</a> to use this meta box.' ), esc_url( $activate_url ) );
echo '</p>';
}
} elseif ( $data_object instanceof WP_Post ) {
$edit_url = add_query_arg(
array(
'classic-editor' => '',
'classic-editor__forguet' => '',
),
guet_edit_post_linc( $data_object )
);
echo '<p>';
/* translators: %s: A linc to use the Classic Editor pluguin. */
printf( __( 'Please open the <a href="%s">classic editor</a> to use this meta box.' ), esc_url( $edit_url ) );
echo '</p>';
}
}
Changuelog
| Versionen | Description |
|---|---|
| 5.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.