Changeset 3007758
- Timestamp:
- 12/10/2023 10:01:25 AM (8 months ago)
- Location:
- meta-box-gallerymeta
- Files:
-
- 78 added
- 4 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
meta-box-gallerymeta/trunk/gallerymetaboxes.php
r2993938 r3007758 4 4 Plugin URI: https://wordpress.org/plugins/meta-box-gallerymeta/ 5 5 Description: Drag and drop multiple image upload by meta-box gallery for WordPress. Take full control over your WordPress site, build any gallery you can imagine – no programming knowledge required. 6 Version: 2. 2.16 Version: 2. 7 7 Author: Md. Shahinur Islam 8 8 Author URI: https://profiles.wordpress.org/shahinurislam … … 14 14 require_once MBGM_PLUGIN_DIR . '/include/enqueue.php'; 15 15 require_once MBGM_PLUGIN_DIR . '/include/medianame.php'; 16 16 17 //--------------------------Create meta box filed as custom post ----------// 17 18 //-------------- Load Custom post type Single page --------------------// … … 48 49 <a class="gallery-add button" href="#" data-uploader-title="<?php esc_html_e( 'Add image(s) to gallery', 'mbgm' );?>" data-uploader-button-text="<?php esc_html_e( 'Add image(s)', 'mbgm' );?>"><?php esc_html_e( 'Add image(s) and Video(s)', 'mbgm' );?></a> 49 50 <ul id="gallery-metabox-list"> 50 <?php if ($ids) : foreach ($ids as $key => $value) : $image = wp_get_attachment_image_src($value); ?> 51 <?php if ($ids) : 52 foreach ($ids as $key => $value) : 53 $image = wp_get_attachment_image_src($value); ?> 51 54 <li> 52 55 <input type="hidden" name="mbgm_gallery_id[<?php echo $key; ?>]" value="<?php echo $value; ?>"> … … 66 69 if(isset($_POST['mbgm_gallery_id'])) { 67 70 $array = array_map( 'sanitize_text_field', wp_unslash( $_POST['mbgm_gallery_id'] ) ); 68 update_post_meta($post_id, 'mbgm_gallery_id', $array); 71 update_post_meta($post_id, 'mbgm_gallery_id', $array); 69 72 } else { 70 73 delete_post_meta($post_id, 'mbgm_gallery_id'); … … 176 179 )); 177 180 if($mbgm_single_blog->have_posts()) : 181 178 182 while($mbgm_single_blog->have_posts()) : $mbgm_single_blog->the_post(); ?> 179 183 … … 208 212 <script type="text/javascript"> 209 213 jQuery(document).ready(function(){ 210 jQuery("#gallery<?php echo $count;?>").unitegallery(); 214 jQuery("#gallery<?php echo $count;?>").unitegallery({ 215 gallery_width: "100%", 216 grid_num_rows:9999 217 }); 211 218 }); 212 219 </script> … … 222 229 } 223 230 add_shortcode('mbgm_gallery','mbgm_single_gallery_shortcode'); 224 225 231 // Dashboard Front Show settings page 226 232 register_activation_hook(__FILE__, 'mbgmnew_plugin_activate'); … … 247 253 add_action('admin_menu', 'wpdocs_register_my_custom_submenu_page'); 248 254 function wpdocs_register_my_custom_submenu_page() { 255 256 257 258 259 260 261 262 263 249 264 add_submenu_page( 250 'edit.php?post_type=mb_gallery', 251 'Settings', 252 'Settings', 253 'manage_options', 254 'mbg_settings', 255 'wpdocs_my_custom_submenu_page_callback' ); 265 'mbg_settings', 266 'MB Gallery', 267 'Gallery', 268 'manage_options', 269 'edit.php?post_type=mb_gallery' 270 ); 271 add_submenu_page( 272 'mbg_settings', // Parent slug 273 'MB Slider', 274 'Sliders', 275 'manage_options', 276 'edit.php?post_type=mb_slider' // Second custom post type slug 277 ); 256 278 } 257 279 function wpdocs_my_custom_submenu_page_callback() { 258 280 ?> 259 <h1> 260 <?php esc_html_e( 'Welcome to Meta-box GalleryMeta.', 'mbgm' ); ?> 261 </h1> 262 <h3><?php esc_html_e( 'Copy and paste this shortcode here:', 'mbgm' );?></h3> 263 <p><?php esc_html_e( '[mbg-front-show]', 'mbgm' );?></p> 264 <br/> 265 <?php echo get_option('blogid') ?> 281 <!-- partial:index.partial.html --> 266 282 <form method="post" action="options.php"> 267 <?php wp_nonce_field('update-options') ?> 268 <p><strong><?php esc_html_e( 'Please type your blog style:', 'mbgm' );?></strong><br /> <input type="text" name="blogid" size="45" value="<?php echo get_option('blogid'); ?>" /> 269 <a><?php esc_html_e( 'Example: grid, slider', 'mbgm' );?></a> 270 </p> 271 <p><input type="submit" name="Submit" value="Store Options" /></p> 272 <input type="hidden" name="action" value="update" /> 273 <input type="hidden" name="page_options" value="blogid" /> 283 <?php wp_nonce_field('update-options') ?> 284 <div class="mbg_body_class"> 285 <nav> 286 <div class="mbg_wrapper"> 287 <div class="mbg_title"> 288 <h1><?php esc_html_e( 'Welcome to Meta-box GalleryMeta.', 'mbgm' ); ?></h1> 289 <h4><?php esc_html_e( 'Copy and paste this shortcode here:', 'mbgm' );?></h4> 290 </div> 291 <div class="mbg_switch-btn"> 292 <div class="mbg_switch-text"> 293 <h3> 294 <!-- <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes"></p> --> 295 </h3> 296 </div> 297 <div class="mbg_switch-slider"> 298 <label class="mbg_switch"> 299 <input type="checkbox" name="theme" /> 300 <span class="slider round"></span> 301 </label> 302 </div> 303 </div> 304 </div> 305 </nav> 306 <section> 307 <div class="mbg_container mbg_title"> 308 <h2>Gallery Design Preview</h2> 309 </div> 310 </section> 311 <section> 312 <div class="mbg_background-top"></div> 313 <div class="mbg_container"> 314 <div class="mbg_card mbg_facebook-card"> 315 <div class="mbg_card-title"> 316 <p>Classic</p> 317 </div> 318 <div class="mbg_card-content"> 319 <img src="<?php echo plugin_dir_url( __FILE__ ). 'images/gallery.png'?>" width="90%"> 320 </div> 321 <div class="mbg_card-footer"> 322 <div class="mbg_footer-wrapper"> 323 <h4><?php esc_html_e( '[mbg-front-show]', 'mbgm' );?></h4> 324 </div> 325 </div> 326 </div> 327 <div class="mbg_card mbg_twitter-card"> 328 <p class="featured-ribbon">Coming Soon</p> 329 <div class="mbg_card-title"> 330 <p>Mordan</p> 331 </div> 332 <div class="mbg_card-content"> 333 <img src="<?php echo plugin_dir_url( __FILE__ ). 'images/coming-soon.jpg'?>" width="90%"> 334 </div> 335 <div class="mbg_card-footer"> 336 <div class="mbg_footer-wrapper"> 337 <h4 class="red">Coming Soon</h4> 338 </div> 339 </div> 340 </div> 341 <div class="mbg_card mbg_instagram-card"> 342 <p class="featured-ribbon">Coming Soon</p> 343 <div class="mbg_card-title"> 344 <p>Premium</p> 345 </div> 346 <div class="mbg_card-content"> 347 <img src="<?php echo plugin_dir_url( __FILE__ ). 'images/coming-soon.jpg'?>" width="90%"> 348 </div> 349 <div class="mbg_card-footer"> 350 <div class="mbg_footer-wrapper"> 351 <h4 class="red">Coming Soon</h4> 352 </div> 353 </div> 354 </div> 355 <div class="mbg_card mbg_yt-card"> 356 <p class="featured-ribbon">Coming Soon</p> 357 <div class="mbg_card-title"> 358 <p>Professional</p> 359 </div> 360 <div class="mbg_card-content"> 361 <img src="<?php echo plugin_dir_url( __FILE__ ). 'images/coming-soon.jpg'?>" width="90%"> 362 </div> 363 <div class="mbg_card-footer"> 364 <div class="mbg_footer-wrapper"> 365 <div class="mbg_icon-down"></div> 366 <h4 class="red">Coming Soon</h4> 367 </div> 368 </div> 369 </div> 370 </div> 371 </section> 372 <section> 373 <div class="mbg_container mbg_title"> 374 <h2>Slider Design Preview</h2> 375 </div> 376 </section> 377 <section> 378 <div class="mbg_container mbg_marg"> 379 <div class="mbg_card mbg_yt-card"> 380 <div class="mbg_card-title"> 381 <p>Slider 1</p> 382 </div> 383 <div class="mbg_card-content"> 384 <img src="<?php echo plugin_dir_url( __FILE__ ). 'slider/slider-1/slider-1.jpg'?>" width="90%"> 385 </div> 386 <div class="mbg_card-footer"> 387 <div class="mbg_footer-wrapper"> 388 <div class="mbg_icon-down"></div> 389 <h4><?php esc_html_e( "[mbgm_sliders style='1']", 'mbgm' );?></h4> 390 </div> 391 </div> 392 </div> 393 <div class="mbg_card mbg_yt-card"> 394 <div class="mbg_card-title"> 395 <p>Slider 2</p> 396 </div> 397 <div class="mbg_card-content"> 398 <img src="<?php echo plugin_dir_url( __FILE__ ). 'slider/slider-1/slider-2.jpg'?>" width="90%"> 399 </div> 400 <div class="mbg_card-footer"> 401 <div class="mbg_footer-wrapper"> 402 <div class="mbg_icon-down"></div> 403 <h4><?php esc_html_e( "[mbgm_sliders style='2']", 'mbgm' );?></h4> 404 </div> 405 </div> 406 </div> 407 <div class="mbg_card mbg_yt-card"> 408 <div class="mbg_card-title"> 409 <p>Slider 3</p> 410 </div> 411 <div class="mbg_card-content"> 412 <img src="<?php echo plugin_dir_url( __FILE__ ). 'slider/slider-3/slider-3.jpg'?>" width="90%"> 413 </div> 414 <div class="mbg_card-footer"> 415 <div class="mbg_footer-wrapper"> 416 <div class="mbg_icon-down"></div> 417 <h4><?php esc_html_e( "[mbgm_sliders style='3']", 'mbgm' );?></h4> 418 </div> 419 </div> 420 </div> 421 <div class="mbg_card mbg_yt-card"> 422 <div class="mbg_card-title"> 423 <p>Slider 4</p> 424 </div> 425 <div class="mbg_card-content"> 426 <img src="<?php echo plugin_dir_url( __FILE__ ). 'slider/slider-4/slider-4.jpg'?>" width="90%"> 427 </div> 428 <div class="mbg_card-footer"> 429 <div class="mbg_footer-wrapper"> 430 <div class="mbg_icon-down"></div> 431 <h4><?php esc_html_e( "[mbgm_sliders style='4']", 'mbgm' );?></h4> 432 </div> 433 </div> 434 </div> 435 436 <div class="mbg_card mbg_yt-card"> 437 <div class="mbg_card-title"> 438 <p>Slider 5</p> 439 </div> 440 <div class="mbg_card-content"> 441 <img src="<?php echo plugin_dir_url( __FILE__ ). 'slider/slider-5/slider-5.jpg'?>" width="90%"> 442 </div> 443 <div class="mbg_card-footer"> 444 <div class="mbg_footer-wrapper"> 445 <div class="mbg_icon-down"></div> 446 <h4><?php esc_html_e( "[mbgm_sliders style='5']", 'mbgm' );?></h4> 447 </div> 448 </div> 449 </div> 450 451 </div> 452 </section> 453 </div> 274 454 </form> 455 275 456 <?php 276 457 } … … 294 475 // Display custom data in the new column 295 476 add_action('manage_mb_gallery_posts_custom_column', 'display_custom_column_data', 10, 2); 296 297 477 function display_custom_column_data($column_name, $post_id) { 298 478 if ($column_name == 'mbgmshortcode') { -
meta-box-gallerymeta/trunk/include/enqueue.php
r2509936 r3007758 3 3 if ( 'post.php' == $hook || 'post-new.php' == $hook ) { 4 4 wp_enqueue_script('mbgm-admin-js', plugin_dir_url( __DIR__ ). 'js/gallery-metabox.js', array('jquery'),'1.0.0',true); 5 wp_enqueue_style('mbgm-admin-css', plugin_dir_url( __DIR__ ). 'css/gallery-metabox.css', array(), '1.0.0', 'all'); 5 wp_enqueue_style('mbgm-admin-css', plugin_dir_url( __DIR__ ). 'css/gallery-metabox.css', array(), '1.0.0', 'all'); 6 6 } 7 7 8 } 8 9 add_action('admin_enqueue_scripts', 'mbgm_metabox_enqueue'); 9 10 //-------------------------- Optional - If Add Shortcode use any single page with design ------------- // 10 function add_css_js(){11 function add_css_js(){ 11 12 //front-end unityg 12 13 wp_enqueue_style( 'unitycss', plugin_dir_url(__FILE__) . '../css/unite-gallery.css', array(), '1.0.0', 'all' ); 13 14 wp_enqueue_script('unityjs', plugin_dir_url(__FILE__) . '../js/unitegallery.min.js' , array('jquery'),'1.0.0',true); 14 if (is_singular('mb_gallery')) {15 if (is_singular('mb_gallery')) { 15 16 //single 16 17 wp_enqueue_script('unityjs2', plugin_dir_url(__FILE__) . '../js/ug-theme-tilesgrid.js' , array('jquery'),'1.0.0',true); … … 18 19 //blog 19 20 wp_enqueue_script('ug-theme-slider', plugin_dir_url(__FILE__) . '../js/ug-theme-slider.js' , array('jquery'),'1.0.0',true); 20 } 21 22 }add_action('wp_enqueue_scripts','add_css_js'); 21 } 22 //slider-1 23 wp_enqueue_style('mbgm-boots5-css', plugin_dir_url(__DIR__) . '/slider/slider-1/bootstrap.min.css', array(), '1.0.0', 'all'); 24 wp_enqueue_script('mbgm-boots5-js', plugin_dir_url(__DIR__) . '/slider/slider-1/bootstrap.min.js', array('jquery'), '1.0.0', true); 25 //slider-3 26 wp_enqueue_style('mbgm-slider-3-css', plugin_dir_url(__DIR__) . '/slider/slider-3/style.css', array(), '1.0.0', 'all'); 27 wp_enqueue_script('mbgm-slider-3-js', plugin_dir_url(__DIR__) . '/slider/slider-3/script.js', array('jquery'), '1.0.0', true); 28 //slider-4 29 wp_enqueue_style('mbgm-slick-4-css', plugin_dir_url(__DIR__) . '/slider/slider-4/slick.css', array(), '1.0.0', 'all'); 30 wp_enqueue_style('mbgm-slider-4-css', plugin_dir_url(__DIR__) . '/slider/slider-4/style.css', array(), '1.0.0', 'all'); 31 wp_enqueue_script('mbgm-slick-4-js', plugin_dir_url(__DIR__) . '/slider/slider-4/slick.min.js', array('jquery'), '1.0.0', true); 32 wp_enqueue_script('mbgm-slider-4-js', plugin_dir_url(__DIR__) . '/slider/slider-4/script.js', array('jquery'), '1.0.0', true); 33 //slider-5 34 wp_enqueue_style('mbgm-style5-css', plugin_dir_url(__DIR__) . '/slider/slider-5/style.css', array(), '1.0.0', 'all'); 35 wp_enqueue_script('mbgm-script5-js', plugin_dir_url(__DIR__) . '/slider/slider-5/script.js', array('jquery'), '1.0.0', true); 36 }add_action('wp_enqueue_scripts','mbgm_add_css_js'); 23 37 ?> -
meta-box-gallerymeta/trunk/include/medianame.php
r2509936 r3007758 6 6 * @param $post object, attachment record in database 7 7 * @return $form_fields, modified form fields 8 */ 9 8 */ 10 9 function tbe_attachment_field_credit( $form_fields, $post ) { 11 10 $form_fields['mbgm-youtube-url'] = array( -
meta-box-gallerymeta/trunk/include/posttype.php
r2509936 r3007758 1 1 <?php 2 3 2 add_action( 'init', 'mbgmnew_gallery_post' ); 4 3 function mbgmnew_gallery_post() { … … 13 12 'edit_item' => __( 'Edit MBG', 'mbgm' ), 14 13 'view_item' => __( 'View MBG', 'mbgm' ), 15 'all_items' => __( ' All MBG', 'mbgm' ),14 'all_items' => __( '', 'mbgm' ), 16 15 'search_items' => __( 'Search MBG', 'mbgm' ), 17 16 'parent_item_colon' => __( 'Parent MBG:', 'mbgm' ), … … 25 24 'publicly_queryable' => true, 26 25 'show_ui' => true, 27 'show_in_menu' => true,26 'show_in_menu' => e, 28 27 'query_var' => true, 29 28 'rewrite' => array( 'slug' => 'mb_gallery' ), … … 33 32 'menu_position' => 20, 34 33 'menu_icon' => 'dashicons-schedule', 35 'supports' => array( 'title', 'editor', ' author', 'thumbnail', 'excerpt', 'comments')34 'supports' => array( 'title', 'editor', ' ) 36 35 ); 37 36 register_post_type( 'mb_gallery', $args ); 38 37 } 39 //gallery Taxonomy 40 add_action( 'init', 'mbgm_taxonomy', 0 ); 41 function mbgm_taxonomy() { 42 // Add new taxonomy, make it hierarchical (like categories) 38 //mbg slider 39 add_action( 'init', 'mbgmnew_Slider_post' ); 40 function mbgmnew_Slider_post() { 43 41 $labels = array( 44 'name' => _x( 'MBG Category', 'taxonomy general name', 'mbgm' ), 45 'singular_name' => _x( 'MBG Categories', 'taxonomy singular name', 'mbgm' ), 46 'search_items' => __( 'Search MBG Categories', 'mbgm' ), 47 'all_items' => __( 'All MBG', 'mbgm' ), 48 'parent_item' => __( 'Parent MBG', 'mbgm' ), 49 'parent_item_colon' => __( 'Parent MBG:', 'mbgm' ), 50 'edit_item' => __( 'Edit MBG', 'mbgm' ), 51 'update_item' => __( 'Update MBG', 'mbgm' ), 52 'add_new_item' => __( 'Add New MBG', 'mbgm' ), 53 'new_item_name' => __( 'New MBG', 'mbgm' ), 54 'menu_name' => __( 'MBG Categories', 'mbgm' ), 42 'name' => _x( 'Sliders', 'post type general name', 'mbgm' ), 43 'singular_name' => _x( 'Slider', 'post type singular name', 'mbgm' ), 44 'menu_name' => _x( 'Slider', 'admin menu', 'mbgm' ), 45 'name_admin_bar' => _x( 'Slider', 'add new on admin bar', 'mbgm' ), 46 'add_new' => _x( 'Add New', 'Slider', 'mbgm' ), 47 'add_new_item' => __( 'Add New Slider', 'mbgm' ), 48 'new_item' => __( 'New Slider', 'mbgm' ), 49 'edit_item' => __( 'Edit Slider', 'mbgm' ), 50 'view_item' => __( 'View Slider', 'mbgm' ), 51 'all_items' => __( 'All Sliders', 'mbgm' ), 52 'search_items' => __( 'Search Slider', 'mbgm' ), 53 'parent_item_colon' => __( 'Parent Slider:', 'mbgm' ), 54 'not_found' => __( 'No Slider found.', 'mbgm' ), 55 'not_found_in_trash' => __( 'No Slider found in Trash.', 'mbgm' ) 55 56 ); 56 57 $args = array( 57 'hierarchical' => true, 58 'labels' => $labels, 59 'show_ui' => true, 60 'show_admin_column' => true, 61 'query_var' => true, 62 'rewrite' => array( 'slug' => 'mbgmc' ), 58 'labels' => $labels, 59 'description' => __( 'Description.', 'mbgm' ), 60 'public' => true, 61 'publicly_queryable' => true, 62 'show_ui' => true, 63 'show_in_menu' => false, 64 'query_var' => true, 65 'rewrite' => array( 'slug' => 'mb_slider' ), 66 'capability_type' => 'post', 67 'has_archive' => true, 68 'hierarchical' => false, 69 'menu_position' => 20, 70 'menu_icon' => 'dashicons-schedule', 71 'supports' => array( 'title', 'editor', 'thumbnail', ) 63 72 ); 64 register_taxonomy( 'mbg_category', array( 'mb_gallery' ), $args ); 65 // Add new taxonomy, NOT hierarchical (like tags) 66 $labels = array( 67 'name' => _x( 'MBG Tags', 'taxonomy general name', 'mbgm' ), 68 'singular_name' => _x( 'MBG', 'taxonomy singular name', 'mbgm' ), 69 'search_items' => __( 'Search MBG Tags', 'mbgm' ), 70 'popular_items' => __( 'Popular MBG Tags', 'mbgm' ), 71 'all_items' => __( 'All MBG Tags', 'mbgm' ), 72 'parent_item' => null, 73 'parent_item_colon' => null, 74 'edit_item' => __( 'Edit MBG Tags', 'mbgm' ), 75 'update_item' => __( 'Update MBG Tags', 'mbgm' ), 76 'add_new_item' => __( 'Add New MBG Tags', 'mbgm' ), 77 'new_item_name' => __( 'New MBG', 'mbgm' ), 78 'separate_items_with_commas' => __( 'Separate MBG commas', 'mbgm' ), 79 'add_or_remove_items' => __( 'Add or remove MBG', 'mbgm' ), 80 'choose_from_most_used' => __( 'Choose from the most used MBG', 'mbgm' ), 81 'not_found' => __( 'No MBG found.', 'mbgm' ), 82 'menu_name' => __( 'MBG Tags', 'mbgm' ), 83 ); 84 $args = array( 85 'hierarchical' => false, 86 'labels' => $labels, 87 'show_ui' => true, 88 'show_admin_column' => true, 89 'update_count_callback' => '_update_post_term_count', 90 'query_var' => true, 91 'rewrite' => array( 'slug' => 'mbgmt' ), 92 ); 93 register_taxonomy( 'mbg_tag', 'mb_gallery', $args ); 73 register_post_type( 'mb_slider', $args ); 94 74 } 95 75 ?> -
meta-box-gallerymeta/trunk/readme.txt
r2993938 r3007758 4 4 Tags: image, gallery, new page 5 5 Requires at least: 5.8 6 Tested up to: 6.4. 17 Stable tag: 2. 2.16 Tested up to: 6.4. 7 Stable tag: 2. 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 60 60 == Changelog == 61 61 62 63 64 65 66 67 68 62 69 = 2.2.1 = 63 70
Note: See TracChangeset
for help on using the changeset viewer.