Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
PUM_Admin_Popups::add_enabled_toggle_editor( WP_POST $post )
Adds our enabled state toggle to the “Publish” meta box.
Description Description
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Parameters Parameters
- $post
-
(Required) The current post (i.e. the popup).
Source Source
File: classes/Admin/Popups.php
public static function add_enabled_toggle_editor( $post ) { if ( 'publish' !== $post->post_status || 'popup' !== $post->post_type ) { return; } $popup = pum_get_popup( $post->ID ); $enabled = $popup->is_enabled(); $nonce = wp_create_nonce( "pum_save_enabled_state_{$popup->ID}" ); ?> <div class="misc-pub-section" style="display:flex;"> <span style="font-weight: bold; margin-right: 10px;">Popup Enabled </span> <div class="pum-toggle-button"> <input id="pum-enabled-toggle-<?php echo esc_attr( $popup->ID ); ?>" type="checkbox" <?php checked( true, $enabled ); ?> class="pum-enabled-toggle-button" data-nonce="<?php echo esc_attr( $nonce ); ?>" data-popup-id="<?php echo esc_attr( $popup->ID ); ?>"> <label for="pum-enabled-toggle-<?php echo esc_attr( $popup->ID ); ?>" aria-label="Switch to enable popup"></label> </div> </div> <?php }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
1.12 | Introduced. |