init_form_fields(); //$this->subtab_init(); $this->form_messages = array( 'success_message' => __( 'Settings successfully saved.', 'a3_portfolio_shortcodes' ), 'error_message' => __( 'Error: Settings can not save.', 'a3_portfolio_shortcodes' ), 'reset_message' => __( 'Settings successfully reseted.', 'a3_portfolio_shortcodes' ), ); add_action( $this->plugin_name . '-' . $this->form_key . '_settings_end', array( $this, 'include_script' ) ); add_action( $this->plugin_name . '_set_default_settings' , array( $this, 'set_default_settings' ) ); add_action( $this->plugin_name . '_get_all_settings' , array( $this, 'get_settings' ) ); add_action( $this->plugin_name . '_settings_portfolio_shortcode_tag_embed_start', array( $this, 'portfolio_shortcode_tag_embed' ) ); } /*-----------------------------------------------------------------------------------*/ /* subtab_init() */ /* Sub Tab Init */ /*-----------------------------------------------------------------------------------*/ public function subtab_init() { add_filter( $this->plugin_name . '-' . $this->parent_tab . '_settings_subtabs_array', array( $this, 'add_subtab' ), $this->position ); } /*-----------------------------------------------------------------------------------*/ /* set_default_settings() /* Set default settings with function called from Admin Interface */ /*-----------------------------------------------------------------------------------*/ public function set_default_settings() { $GLOBALS[$this->plugin_prefix.'admin_interface']->reset_settings( $this->form_fields, $this->option_name, false ); } /*-----------------------------------------------------------------------------------*/ /* get_settings() /* Get settings with function called from Admin Interface */ /*-----------------------------------------------------------------------------------*/ public function get_settings() { $GLOBALS[$this->plugin_prefix.'admin_interface']->get_settings( $this->form_fields, $this->option_name ); } /** * subtab_data() * Get SubTab Data * ============================================= * array ( * 'name' => 'my_subtab_name' : (required) Enter your subtab name that you want to set for this subtab * 'label' => 'My SubTab Name' : (required) Enter the subtab label * 'callback_function' => 'my_callback_function' : (required) The callback function is called to show content of this subtab * ) * */ public function subtab_data() { $subtab_data = array( 'name' => 'shortcodes-setting', 'label' => __( 'Portfolio Shortcodes', 'a3_portfolio_shortcodes' ), 'callback_function' => 'a3_portfolio_shortcodes_setting_form', ); if ( $this->subtab_data ) return $this->subtab_data; return $this->subtab_data = $subtab_data; } /*-----------------------------------------------------------------------------------*/ /* add_subtab() */ /* Add Subtab to Admin Init /*-----------------------------------------------------------------------------------*/ public function add_subtab( $subtabs_array ) { if ( ! is_array( $subtabs_array ) ) $subtabs_array = array(); $subtabs_array[] = $this->subtab_data(); return $subtabs_array; } /*-----------------------------------------------------------------------------------*/ /* settings_form() */ /* Call the form from Admin Interface /*-----------------------------------------------------------------------------------*/ public function settings_form() { $output = ''; $output .= $GLOBALS[$this->plugin_prefix.'admin_interface']->admin_forms( $this->form_fields, $this->form_key, $this->option_name, $this->form_messages ); return $output; } /*-----------------------------------------------------------------------------------*/ /* init_form_fields() */ /* Init all fields of this form */ /*-----------------------------------------------------------------------------------*/ public function init_form_fields() { // Define settings $this->form_fields = apply_filters( $this->option_name . '_settings_fields', array( array( 'name' => __( 'Portfolio Shortcodes', 'a3_portfolio_shortcodes' ), 'type' => 'heading', 'desc' => __( 'From WordPress Visual editor menu on any page or post use the a3 Portfolio Button to insert Single Items, Portfolio Categories or Portfolio tags into any post or page.', 'a3_portfolio_shortcodes' ), 'id' => '' ), array( 'name' => __( 'Embed Full Portfolio', 'a3_portfolio_shortcodes' ), 'type' => 'heading', 'desc' => __( 'Add the Portfolio to any post, page or widget area by shortcode or template tag. Embeds without the Portfolio title.', 'a3_portfolio_shortcodes' ), 'id' => 'portfolio_shortcode_tag_embed' ), )); } public function portfolio_shortcode_tag_embed() { ?>

[a3_portfolios column="3" number_items="all" show_navbar="1"] :

[a3_portfolio_recent column="3" number_items="all" show_navbar="1"] :

[a3_portfolio_sticky column="3" number_items="all" show_navbar="1"] :

[a3_portfolio_category ids="1,2,3" column="3" number_items="all" show_navbar="1"] :

[a3_portfolio_tag ids="4,5,6" column="3" number_items="all" show_navbar="1"] :

[a3_portfolio_item ids="1,2,3" column="3" width="100%"] :

<?php a3_portfolios( $column, $number_items, $show_navbar ); ?>
<?php a3_portfolio_recent( $column, $number_items, $show_navbar ); ?>
<?php a3_portfolio_sticky( $column, $number_items, $show_navbar ); ?>
<?php a3_portfolio_categories( $cat_ids, $column, $number_items, $show_navbar ); ?>
<?php a3_portfolio_tags( $tag_ids, $column, $number_items, $show_navbar ); ?>
<?php a3_portfolio_items( $portfolio_ids, $column, $number_items, $show_navbar, $custom_style ); ?>
settings_form(); } }