PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 2.3.0
GenerateBlocks v2.3.0
trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / includes / deprecated.php
generateblocks / includes Last commit date
blocks 1 week ago dynamic-tags 1 week ago pattern-library 1 week ago utils 2 years ago class-do-css.php 2 years ago class-dynamic-content.php 1 week ago class-dynamic-tag-security.php 6 months ago class-enqueue-css.php 1 year ago class-legacy-attributes.php 4 years ago class-map-deprecated-attributes.php 2 years ago class-meta-handler.php 3 months ago class-plugin-update.php 1 year ago class-query-loop.php 2 years ago class-query-utils.php 1 week ago class-render-blocks.php 1 year ago class-rest.php 1 year ago class-settings.php 1 year ago dashboard.php 1 year ago defaults.php 1 year ago deprecated.php 1 year ago functions.php 1 week ago general.php 1 week ago
deprecated.php
70 lines
1 <?php
2 /**
3 * Deprecated functions.
4 *
5 * @package GenerateBlocks
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 /**
13 * Redirect to the Dashboard page on single plugin activation.
14 *
15 * @since 0.1
16 * @deprecated 2.0.0
17 */
18 function generateblocks_dashboard_redirect() {
19 $do_redirect = apply_filters( 'generateblocks_do_activation_redirect', get_option( 'generateblocks_do_activation_redirect', false ) );
20
21 if ( $do_redirect ) {
22 delete_option( 'generateblocks_do_activation_redirect' );
23 wp_safe_redirect( esc_url( admin_url( 'admin.php?page=generateblocks' ) ) );
24 exit;
25 }
26 }
27
28 /**
29 * Adds a redirect option during plugin activation on non-multisite installs.
30 *
31 * @since 0.1
32 * @deprecated 2.0.0
33 *
34 * @param bool $network_wide Whether or not the plugin is being network activated.
35 */
36 function generateblocks_do_activate( $network_wide = false ) {
37 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Only used to do a redirect. False positive.
38 if ( ! $network_wide && ! isset( $_GET['activate-multi'] ) ) {
39 update_option( 'generateblocks_do_activation_redirect', true );
40 }
41 }
42
43 /**
44 * Output permissions for use in admin objects.
45 *
46 * @deprecated 2.1.0
47 * @return void
48 */
49 function generateblocks_admin_head_scripts() {
50 $permissions = apply_filters(
51 'generateblocks_permissions',
52 [
53 'isAdminUser' => current_user_can( 'manage_options' ),
54 'canEditPosts' => current_user_can( 'edit_posts' ),
55 'isGbProActive' => is_plugin_active( 'generateblocks-pro/plugin.php' ),
56 'isGpPremiumActive' => is_plugin_active( 'gp-premium/gp-premium.php' ),
57 ]
58 );
59
60 $permission_object = wp_json_encode( $permissions );
61
62 echo sprintf(
63 '<script>
64 const gbPermissions = %s;
65 Object.freeze( gbPermissions );
66 </script>',
67 $permission_object // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
68 );
69 }
70