shortcode['title'] = esc_html__( 'Donation Form Goal', 'give' ); $this->shortcode['label'] = esc_html__( 'Donation Form Goal', 'give' ); parent::__construct( 'give_goal' ); } /** * Define the shortcode attribute fields * * @return array */ public function define_fields() { $create_form_link = sprintf( /* translators: %s: create new form URL */ __( 'Create a new Donation Form.', 'give' ), admin_url( 'post-new.php?post_type=give_forms' ) ); return array( array( 'type' => 'post', 'query_args' => array( 'post_type' => 'give_forms', 'meta_key' => '_give_goal_option', 'meta_value' => 'enabled', ), 'name' => 'id', 'tooltip' => esc_attr__( 'Select a Donation Form', 'give' ), 'placeholder' => '- ' . esc_attr__( 'Select a Donation Form', 'give' ) . ' -', 'required' => array( 'alert' => esc_html__( 'You must first select a Form!', 'give' ), 'error' => sprintf( '

%s

%s

', esc_html__( 'No forms found.', 'give' ), $create_form_link ), ), ), array( 'type' => 'container', 'html' => sprintf( '

%s

', esc_html__( 'Optional settings', 'give' ) ), ), array( 'type' => 'listbox', 'name' => 'show_text', 'label' => esc_attr__( 'Show Text:', 'give' ), 'tooltip' => esc_attr__( 'This text displays the amount of income raised compared to the goal.', 'give' ), 'options' => array( 'true' => esc_html__( 'Show', 'give' ), 'false' => esc_html__( 'Hide', 'give' ), ), ), array( 'type' => 'listbox', 'name' => 'show_bar', 'label' => esc_attr__( 'Show Progress Bar:', 'give' ), 'tooltip' => esc_attr__( 'Do you want to display the goal\'s progress bar?', 'give' ), 'options' => array( 'true' => esc_html__( 'Show', 'give' ), 'false' => esc_html__( 'Hide', 'give' ), ), ), ); } } new Give_Shortcode_Donation_Form_Goal;