Changeset 3115898
- Timestamp:
- 07/10/2024 09:44:13 PM (4 weeks ago)
- Location:
- menu-item-types/trunk
- Files:
-
- 71 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
menu-item-types/trunk/config.php
r3096654 r3115898 3 3 defined( 'ABSPATH' ) or die(); 4 4 5 // Plugin version6 define( 'MITYPES_VERSION', 1.4 );7 8 // Plugin names9 define( 'MITYPES_PLUGIN_NAME' , 'Menu Item types' );10 define( 'MITYPES_PLUGIN_SLUG' , sanitize_key( MITYPES_PLUGIN_NAME ) );11 12 // Plugin folder13 define( 'MITYPES_PLUGIN_FOLDER_INSTALL' , plugin_dir_path( __DIR__ ) );14 15 // Path base16 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 24 5 // ACF 25 define( 'MITYPES_ACF_PREFIX_GROUP' , 'group_mit_' ); 26 define( 'MITYPES_ACF_PREFIX_FIELD' , 'field_mit_' ); 27 28 6 define( 'MITYPES_ACF_PREFIX_GROUP', 'group_mit_' ); 7 define( 'MITYPES_ACF_PREFIX_FIELD', 'field_mit_' ); -
menu-item-types/trunk/menu-item-types.php
r3096654 r3115898 4 4 Plugin URI: https://maxpertici.fr#menu-item-types 5 5 Description: Use elements of a personalized type in the navigation menus. 6 Version: 1. 46 Version: 1. 7 7 Author: @maxpertici 8 8 Author URI: https://maxpertici.fr … … 14 14 */ 15 15 16 defined( 'ABSPATH' ) or 16 defined( 'ABSPATH' ) ordie(); 17 17 18 18 19 19 /**20 * Load defines21 * @since 1.022 */23 20 require_once( 'config.php' ); 21 24 22 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 4 4 "description": "", 5 5 "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": {}, 21 9 "keywords": [], 22 10 "author": "maxpertici", -
menu-item-types/trunk/readme.txt
r3096654 r3115898 4 4 Tags: Menu, Custom, Nav item 5 5 Requires at least: 5.8 6 Tested up to: 6. 5.47 Stable tag: 1. 46 Tested up to: 6. 7 Stable tag: 1. 8 8 Requires PHP: 7.0 9 9 License: GPLv2 … … 17 17 [vimeo https://vimeo.com/659116094] 18 18 19 == Filters ==20 19 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 21 48 ` 22 49 // Disable Post Type Archive Metabox … … 35 62 add_filter( 'mitypes_nav_menu_items_has_icons', '__return_false' ) ; 36 63 ` 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 46 64 47 65 == Installation == … … 63 81 64 82 == Changelog == 83 84 85 86 87 88 89 65 90 66 91 = 1.4 =
Note: See TracChangeset
for help on using the changeset viewer.