Plugin Directory

Changeset 2648336


Ignore:
Timestamp:
12/23/2021 12:07:30 PM (4 years ago)
Author:
wooprali
Message:

Added Menu Position

Location:
wpi-designer-button-shortcode/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wpi-designer-button-shortcode/trunk/inc/buttons.php

    r1508485 r2648336  
    2525            array("label"=>"Popup Type", "name"=>'popup_type', "type"=>"select", "section"=>"Link Section", "group"=>"Link", "value"=> "", "list"=>  array("0"=>"default","preset_1"=>"Full Width"), "linked_field"=>"button_type", "linked_field_item"=>"popup"),
    2626            array("label"=>"Menu", "name"=>'menu', "type"=>"select", "section"=>"Link Section", "group"=>"Link", "value"=> "", "list"=> $menu_items, "linked_field"=>"button_type", "linked_field_item"=>"menu"),
     27            array("label"=>"Menu Position", "name"=>'menu_position', "type"=>"select",
     28                "section"=>"Link Section", "group"=>"Link", "value"=> "",
     29                "list"=>  array("0"=>"default","top"=>"Top","bottom"=>"Bottom"),
     30                "linked_field"=>"button_type", "linked_field_item"=>"menu"),
    2731            array("label"=>"Target", "name"=>'target', "type"=>"select", "section"=>"Link Section", "group"=>"Link", "value"=> "", "list"=> array("self"=>"Self","_blank"=>"New Window"), "linked_field"=>"button_type", "linked_field_item"=>"link"), 
    2832            array("label"=>"Rel", "name"=>'rel', "type"=>"text", "section"=>"Link Section", "group"=>"Link", "value"=> "", "linked_field"=>"button_type", "linked_field_item"=>"link", "global_enabled"=>"button_rel"),
  • wpi-designer-button-shortcode/trunk/readme.txt

    r2518258 r2648336  
    55Plugin URI: http://designerbutton.prali.in
    66Author URI: http://wooprali.prali.in
    7 Requires at least: 3.0.1
     7Requires at least: 3.0.2
    88Tested up to: 5.6.0
    99Stable tag: 2.6.0
     
    163163
    164164== Changelog ==
     165= 3.0.2 =
     166Added Button Menu Position
    165167= 3.0.1 =
    166168Input Value Fix
  • wpi-designer-button-shortcode/trunk/style.css

    r1421671 r2648336  
    375375    display:none;
    376376}
     377.wpi_button_menu_base_container.wpi_button_menu_bottom {   
     378    top: 100%;
     379    bottom:auto;
     380}
    377381.wpi_button_menu_base_container .menu {
    378382    padding: 0px 0px;
     
    380384    background-color: rgba(255,255,255,0.95);
    381385    box-shadow: 2px 2px 2px rgba(0,0,0,0.3);   
     386}
     387.wpi_button_menu_base_container.wpi_button_menu_bottom .menu {   
     388    margin-top: 45px;
     389    margin-bottom: 0px;
    382390}
    383391.wpi_button_menu_base_container .sub-menu {
  • wpi-designer-button-shortcode/trunk/wpi-designer-button-shortcode.php

    r2518258 r2648336  
    1414defined('ABSPATH') or die("No script kiddies please!");
    1515if ( !defined('WPIDB_URL' ) ) {
    16     define( 'WPIDB_VER', "3.0.1" );
     16    define( 'WPIDB_VER', "3.0.2" );
    1717    define( 'WPIDB_URL', plugin_dir_url( __FILE__ ) );
    1818    define( 'WPIDB_PLUGIN', plugin_basename( __FILE__) );   
     
    3535class WPiDesignerButtonShortcode{
    3636
    37     const VERSION = '3.0.1';   
     37    const VERSION = '3.0.2';   
    3838    public function __construct(){ 
    39         define( 'WPI_DESIGNER_BUTTON_SHORTCODE', '3.0.1' );
     39        define( 'WPI_DESIGNER_BUTTON_SHORTCODE', '3.0.2' );
    4040        define( 'DEV', "?t=".rand(0,1000) );
    4141        //define( 'DEV', "");       
     
    563563    public function designer_button($atts_input, $content=""){
    564564        static $shortcode_count=0; $shortcode_count++;
    565         $defaults=array("id"=>"", "style_id"=>"", "slide_id"=>"", "share_id"=>"", "twin_id"=>"", "smart_id"=>"", 'link'=>'#', 'text'=>'button', "target"=>"", "icon"=>"", "display"=>false, "icon_position"=>"left", "rel" => "", "on_click" => "", "button_type" =>"", "popup" =>"", "popup_type" =>"", "menu" =>"");
     565        $defaults=array("id"=>"", "style_id"=>"", "slide_id"=>"", "share_id"=>"", "twin_id"=>"", "smart_id"=>"", 'link'=>'#', 'text'=>'button', "target"=>"", "icon"=>"", "display"=>false, "icon_position"=>"left", "rel" => "", "on_click" => "", "button_type" =>"", "popup" =>"", "popup_type" =>"", "menu" =>"", "menu_position"=>"top", );
    566566        $atts=shortcode_atts($defaults, $atts_input, "wpi_designer_button");
    567567        $button="";
     
    576576            $atts['popup_type']=get_post_meta($atts['id'], "popup_type",true);
    577577            $atts['menu']=get_post_meta($atts['id'], "menu",true);
     578            $atts['menu_position']=get_post_meta($atts['id'], "menu_position",true);
    578579            if( $atts['link']=="" || $atts['link']=="#"){
    579580                $atts['link']=get_post_meta($atts['id'], "link",true);             
     
    666667            if ( ! $menu ) {
    667668                $button_menu="";
    668             }else{
     669            }else{     
     670                $menu_container_class= ' wpi_button_menu_base_container '; 
     671                if($atts['menu_position']=="bottom") $menu_container_class.= ' wpi_button_menu_bottom ';       
    669672                $menu_items = wp_get_nav_menu_items($menu->term_id);
    670673                $menu_list1=wp_nav_menu(array(
    671674                    "menu"=>$menu->term_id,
    672675                    "echo"=>false,
    673                     "container_class"=>"wpi_button_menu_base_container",
     676                    "container_class"=>$menu_container_class,
    674677                    "container_id"=>"wpi_button_menu_base_".$atts['id'],               
    675678                ));
    676679                $button_menu=$menu_list1;                       
    677             }       
    678             $button_menu_class=" wpi_button_menu ";
     680            }              
     681            $button_menu_class=" wpi_button_menu ";                 
    679682            $atts['link']='';       
    680683        }else{
Note: See TracChangeset for help on using the changeset viewer.