/home/techb158/public_html/wp-content/plugins/optinmonster/OMAPI
NameSizeModeActions
EasyDigitalDownloads/-0755rm
Elementor/-0755rm
Integrations/-0755rm
MemberPress/-0755rm
Plugins/-0755rm
Promos/-0755rm
Rules/-0755rm
Shortcodes/-0755rm
WooCommerce/-0755rm
WPForms/-0755rm
Actions.php79700666editdlrm
Ajax.php14940666editdlrm
Api.php145070666editdlrm
ApiAuth.php24630666editdlrm
ApiKey.php52030666editdlrm
AssetLoader.php54890666editdlrm
BaseRestApi.php68890666editdlrm
Blocks.php131050666editdlrm
ClassicEditor.php70840666editdlrm
ConstantContact.php75910666editdlrm
Debug.php45920666editdlrm
EasyDigitalDownloads.php95530666editdlrm
Elementor.php54930666editdlrm
Inserter.php115710666editdlrm
InstallSkin.php13860666editdlrm
InstallSkinCompat.php13950666editdlrm
MailPoet.php139740666editdlrm
MemberPress.php42160666editdlrm
Menu.php173010666editdlrm
Notifications.php189100666editdlrm
OmuApi.php41220666editdlrm
Output.php258480666editdlrm
Pages.php180190666editdlrm
Partners.php55570666editdlrm
Plugins.php249230666editdlrm
Promos.php11310666editdlrm
Refresh.php65530666editdlrm
RestApi.php441900666editdlrm
RevenueAttribution.php30370666editdlrm
Review.php14820666editdlrm
Rules.php240000666editdlrm
Save.php119990666editdlrm
Shortcode.php36670666editdlrm
Sites.php85530666editdlrm
Support.php91920666editdlrm
Type.php37220666editdlrm
Urls.php89510666editdlrm
Utils.php75890666editdlrm
Validate.php92660666editdlrm
Welcome.php49290666editdlrm
Widget.php66620666editdlrm
WooCommerce.php200450666editdlrm
WpErrorException.php7140666editdlrm
WPForms.php26650666editdlrm
Edit: /home/techb158/public_html/wp-content/plugins/optinmonster/OMAPI/ClassicEditor.php (7084B)
set(); add_action( 'media_buttons', array( $this, 'media_button' ), 15 ); add_action( 'add_meta_boxes', array( $this, 'settings_meta_box' ) ); add_action( 'save_post', array( $this, 'save_metabox_data' ), 10, 2 ); } /** * Sets our object instance and base class instance. * * @since 2.3.0 */ public function set() { self::$instance = $this; $this->base = OMAPI::get_instance(); } /** * Allow easy shortcode insertion via a custom media button. * * @since 2.3.0 * * @param string $editor_id Unique editor identifier, e.g. 'content'. */ public function media_button( $editor_id ) { if ( ! $this->base->can_access( 'campaign_media_button' ) ) { return; } // Provide the ability to conditionally disable the button, so it can be // disabled for custom fields or front-end use such as bbPress. We default // to only showing within the post editor page. if ( ! apply_filters( 'optin_monster_display_media_button', $this->is_post_editor_page(), $editor_id ) ) { return; } // Setup the icon. $icon = '' . $this->base->menu->icon_svg( 'currentColor', false ) . ''; printf( '', esc_attr( $editor_id ), esc_attr__( 'Add OptinMonster', 'optin-monster-api' ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, unable to escape SVG. $icon, esc_html__( 'Add OptinMonster', 'optin-monster-api' ) ); // If we have made it this far then load the JS. $handle = $this->base->plugin_slug . '-editor'; wp_enqueue_script( $handle, $this->base->url . 'assets/dist/js/editor.min.js', array( 'jquery' ), $this->base->asset_version(), true ); $i18n = $this->base->blocks->get_data_for_js( 'i18n' ); $i18n['or_monsterlink'] = esc_html__( 'Or link to a popup campaign', 'optin-monster-api' ); OMAPI_Utils::add_inline_script( $handle, 'OMAPI_Editor', array( 'monsterlink' => esc_url_raw( OPTINMONSTER_SHAREABLE_LINK ) . '/c/', 'canMonsterlink' => $this->base->blocks->get_data_for_js( 'canMonsterlink' ), 'upgradeUri' => $this->base->blocks->get_data_for_js( 'upgradeUri' ), 'i18n' => $i18n, ) ); add_action( 'admin_footer', array( $this, 'shortcode_modal' ) ); } /** * Check if we are on the post editor admin page. * * @since 2.3.0 * * @returns boolean True if it is post editor admin page. */ public function is_post_editor_page() { if ( ! is_admin() ) { return false; } // get_current_screen() is loaded after 'admin_init' hook and may not exist yet. if ( ! function_exists( 'get_current_screen' ) ) { return false; } $screen = get_current_screen(); return null !== $screen && 'edit' === $screen->parent_base; } /** * Modal window for inserting the optin-monster shortcode into TinyMCE. * * Thickbox is old and busted so we don't use that. Creating a custom view in * Backbone would make me pull my hair out. So instead we offer a small clean * modal that is based off of the WordPress insert link modal. * * @since 2.3.0 */ public function shortcode_modal() { $campaigns = $this->base->blocks->get_campaign_options( true ); $campaigns['inline'] = ! empty( $campaigns['inline'] ) ? array_merge( array( '' => esc_html__( 'Select Campaign...', 'optin-monster-api' ) ), $campaigns['inline'] ) : array(); $campaigns['other'] = ! empty( $campaigns['other'] ) ? array_merge( array( '' => esc_html__( 'Select Campaign...', 'optin-monster-api' ) ), $campaigns['other'] ) : array(); $this->base->output_view( 'shortcode-modal.php', array( 'templatesUri' => $this->base->blocks->get_data_for_js( 'templatesUri' ), 'upgradeUri' => OMAPI_Urls::upgrade( 'gutenberg', 'monster-link' ), 'canMonsterlink' => $this->base->blocks->get_data_for_js( 'canMonsterlink' ), 'campaigns' => $campaigns, ) ); $this->base->output_min_css( 'shortcode-modal-css.php' ); } /** * Register the global OptinMonster Settings metabox. * * @since 2.3.0 */ public function settings_meta_box() { $types = array_values( get_post_types( array( 'public' => true ) ) ); foreach ( $types as $type ) { $supports_custom_fields = post_type_supports( $type, 'custom-fields' ); // If custom fields aren't supported, change title to avoid duplicate 'OptinMonster' sections. // @see https://github.com/awesomemotive/optin-monster-wp-api/issues/391 $title = $supports_custom_fields ? 'OptinMonster Settings' : 'Campaign Settings'; add_meta_box( 'om-global-post-settings', esc_html__( $title, 'optin-monster-api' ), array( $this, 'settings_meta_box_output' ), $type, 'side', 'default', array( '__back_compat_meta_box' => $supports_custom_fields ) ); } } /** * Output the markup for the global OptinMonster Settings metabox. * * @since 2.3.0 * * @param WP_Post $post The post object. */ public function settings_meta_box_output( $post ) { $disabled = get_post_meta( $post->ID, 'om_disable_all_campaigns', true ); wp_nonce_field( 'om_disable_all_campaigns', 'om_disable_all_campaigns_nonce' ); ?>

post_type ) ) { return; } $type = get_post_type_object( $post->post_type ); if ( empty( $type->cap->edit_post ) || ! current_user_can( $type->cap->edit_post, $post_id ) ) { return; } $disabled = ! empty( $_POST['om_disable_all_campaigns'] ); update_post_meta( $post_id, 'om_disable_all_campaigns', $disabled ); } }