PM_POPUPSHOW::define_action()
Define and register the action by pushing it into the Automator object
Source Source
File: src/integrations/popup-maker/actions/pm-popupshow.php
public function define_action() { global $wpdb; $automator_popups = $wpdb->get_col( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'popup_settings' AND meta_value LIKE '%automator%'" ); $args = [ 'post_type' => 'popup', 'posts_per_page' => 999, 'orderby' => 'title', 'order' => 'ASC', 'post_status' => 'publish', //'include' => $automator_popups, ]; $options = Automator()->helpers->recipe->options->wp_query( $args, false, esc_attr__( 'Any popup', 'uncanny-automator' ) ); $option = [ 'option_code' => 'POPUPID', 'label' => esc_attr__( 'Popup', 'uncanny-automator' ), 'input_type' => 'select', 'required' => true, 'options' => $options, 'custom_value_description' => esc_attr__( 'Popup ID', 'uncanny-automator' ), ]; $action = array( 'author' => 'Uncanny Automator', 'support_link' => Automator()->get_author_support_link($this->action_code,'knowledge-base/working-with-popup-maker-actions'), 'integration' => self::$integration, 'code' => $this->action_code, /* translators: Logged-in trigger - Popup Maker */ 'sentence' => sprintf( esc_attr__( 'Show {{a popup:%1$s}}', 'uncanny-automator' ), $this->action_meta ), /* translators: Logged-in trigger - Popup Maker */ 'select_option_name' => esc_attr__( 'Show {{a popup}}', 'uncanny-automator' ), 'priority' => 11, 'accepted_args' => 3, 'execution_function' => [ $this, 'display_pop_up' ], 'options' => [ $option, ], ); Automator()->register->action( $action ); }
Expand full source code Collapse full source code View on Github