Plugin Directory

Changeset 3115898

Timestamp:
07/10/2024 09:44:13 PM (4 weeks ago)
Author:
maxpertici
Message:

MITYPES / trunk / 1.5

Location:
menu-item-types/trunk
Files:
71 added
4 edited

Legend:

Unmodified
Added
Removed
  • menu-item-types/trunk/config.php

    r3096654 r3115898  
    33defined( 'ABSPATH' ) or die();
    44
    5 // Plugin version
    6 define( 'MITYPES_VERSION', 1.4 );
    7 
    8 // Plugin names
    9 define( 'MITYPES_PLUGIN_NAME' , 'Menu Item types' );
    10 define( 'MITYPES_PLUGIN_SLUG' , sanitize_key( MITYPES_PLUGIN_NAME ) );
    11 
    12 // Plugin folder
    13 define( 'MITYPES_PLUGIN_FOLDER_INSTALL' , plugin_dir_path( __DIR__ ) );
    14 
    15 // Path base
    16 define( 'MITYPES_FILE' , __FILE__ );
    17 define( 'MITYPES_PATH' , realpath( plugin_dir_path( MITYPES_FILE ) ) . '/' );
    18 
    19 define( 'MITYPES_INC_PATH'   , realpath( MITYPES_PATH     . 'inc' )     . '/' );
    20 define( 'MITYPES_ACF_PATH'   , realpath( MITYPES_INC_PATH . 'acf' )     . '/' );
    21 define( 'MITYPES_ADMIN_PATH' , realpath( MITYPES_INC_PATH . 'admin' )   . '/' );
    22 define( 'MITYPES_METABOX'    , realpath( MITYPES_INC_PATH . 'metabox' ) . '/' );
    23 
    245// ACF
    25 define( 'MITYPES_ACF_PREFIX_GROUP'            , 'group_mit_' );
    26 define( 'MITYPES_ACF_PREFIX_FIELD'            , 'field_mit_' );
    27 
    28 
     6define( 'MITYPES_ACF_PREFIX_GROUP', 'group_mit_' );
     7define( 'MITYPES_ACF_PREFIX_FIELD', 'field_mit_' );
  • menu-item-types/trunk/menu-item-types.php

    r3096654 r3115898  
    44Plugin URI:   https://maxpertici.fr#menu-item-types
    55Description:  Use elements of a personalized type in the navigation menus.
    6 Version:      1.4
     6Version:      1.
    77Author:       @maxpertici
    88Author URI:   https://maxpertici.fr
     
    1414*/
    1515
    16 defined( 'ABSPATH' ) or die();
     16defined( 'ABSPATH' ) ordie();
    1717
     18
    1819
    19 /**
    20  * Load defines
    21  * @since 1.0
    22  */
    2320require_once( 'config.php' );
     21
    2422
    25 
    26 /**
    27  * Run plugin
    28  * @since 1.0
    29  */
    30 
    31 function mitypes_run(){
    32 
    33     // Get Translations
    34     $locale = get_locale();
    35     $locale = apply_filters( 'plugin_locale', $locale, 'menu-item-types' );
    36     load_textdomain( 'menu-item-types', WP_LANG_DIR . '/plugins/menu-item-types-' . $locale . '.mo' );
    37     load_plugin_textdomain( 'menu-item-types', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
    38 
    39     // Has ACF ?
    40     require( MITYPES_ACF_PATH . 'acf.php' );
    41 
    42     if( ! mitypes_is_acf_loaded() ){
    43         add_action('admin_notices', 'mitypes_notice_acf_plugin_required');
    44     }
    45 
    46     if( mitypes_is_acf_loaded() ){
    47 
    48         if( is_admin() ){
    49             add_action( 'acf/init', 'mitypes_location_types'  );
    50             add_action( 'acf/init', 'mitypes_load_acf_fields' );
    51         }
    52     }
    53 }
    54 
    55 add_action( 'plugins_loaded', 'mitypes_run' );
    56 
    57 
    58 
    59 
    60 /**
    61  * Second load, initialisation et fire mitypes_loaded action
    62  *
    63  * @since 1.0
    64  */
    65 function mitypes_init() {
    66 
    67     if( mitypes_is_acf_loaded() ){
    68 
    69         // Admin ?
    70         if( is_admin() ){
    71             require_once( MITYPES_ADMIN_PATH . 'wp_admin.php' );
    72             require_once( MITYPES_METABOX    . 'mitypes-menu-item-types.php' ) ;
    73         }
    74        
    75         if( ! is_admin() ){
    76             require_once( MITYPES_INC_PATH   . 'render/menu-item-types-render.php' );
    77         }
    78 
    79         /**
    80          * Fires when MIP is loaded
    81          * @since 1.0
    82         */
    83         do_action( 'mitypes_loaded' );
    84     }
    85 }
    86 
    87 
    88 add_action( 'after_setup_theme', 'mitypes_init' );
    89 
    90 
     23$App = App::instance();
     24$App->createFromFile( __FILE__ );
     25$App->load();
  • menu-item-types/trunk/package.json

    r2807542 r3115898  
    44  "description": "",
    55  "main": "gulpfile.js",
    6   "dependencies": {
    7     "@fancyapps/fancybox": "^3.5.7",
    8     "gulp-plumber": "^1.2.0",
    9     "gulp-sourcemaps": "^2.6.4"
    10   },
    11   "devDependencies": {
    12     "browser-sync": "^2.24.4",
    13     "gulp": "^3.9.1",
    14     "gulp-autoprefixer": "^6.1.0",
    15     "gulp-sass": "^5.1.0",
    16     "sass": "^1.4.0"
    17   },
    18   "scripts": {
    19     "test": "echo \"Error: no test specified\" && exit 1"
    20   },
     6  "dependencies": {},
     7  "devDependencies": {},
     8  "scripts": {},
    219  "keywords": [],
    2210  "author": "maxpertici",
  • menu-item-types/trunk/readme.txt

    r3096654 r3115898  
    44Tags: Menu, Custom, Nav item
    55Requires at least: 5.8
    6 Tested up to: 6.5.4
    7 Stable tag: 1.4
     6Tested up to: 6.
     7Stable tag: 1.
    88Requires PHP: 7.0
    99License: GPLv2
     
    1717[vimeo https://vimeo.com/659116094]
    1818
    19 == Filters ==
    2019
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
    2148`
    2249// Disable Post Type Archive Metabox
     
    3562add_filter( 'mitypes_nav_menu_items_has_icons', '__return_false' ) ;
    3663`
    37 
    38 == Menu Item Types can be extended ==
    39 
    40 There are already additional plugins.
    41 You can also create your own elements like these plugins do:
    42 
    43 * [Menu Item Types — Button](https://wordpress.org/plugins/menu-item-types-button/)
    44 * [Menu Item Types — Action](https://wordpress.org/plugins/menu-item-types-action/)
    45 
    4664
    4765== Installation ==
     
    6381
    6482== Changelog ==
     83
     84
     85
     86
     87
     88
     89
    6590
    6691= 1.4 =
Note: See TracChangeset for help on using the changeset viewer.