Changeset 2218386
- Timestamp:
- 12/26/2019 10:15:44 PM (6 years ago)
- Location:
- lorem-carousel/trunk
- Files:
-
- 8 edited
-
admin/class-lorem-carousel-admin.php (modified) (1 diff)
-
admin/class-lorem-carousel-metabox.php (modified) (5 diffs)
-
includes/class-lorem-carousel.php (modified) (1 diff)
-
lorem-carousel.php (modified) (2 diffs)
-
public/class-lorem-carousel-public.php (modified) (2 diffs)
-
public/css/lorem-carousel-public.css (modified) (1 diff)
-
public/js/lorem-carousel-public.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lorem-carousel/trunk/admin/class-lorem-carousel-admin.php
r2216641 r2218386 5 5 * 6 6 * @link https://owlpixel.com 7 * @since 1.0. 07 * @since 1.0.1 8 8 * 9 9 * @package Lorem_Carousel -
lorem-carousel/trunk/admin/class-lorem-carousel-metabox.php
r2216641 r2218386 39 39 $cmb = new_cmb2_box( array( 40 40 'id' => 'test_metabox', 41 'title' => __( ' Test Metabox', 'cmb2' ),41 'title' => __( 'Upload Carousel Images', 'cmb2' ), 42 42 'object_types' => array( 'lorem_carousel' ), // Post type 43 43 'context' => 'normal', … … 65 65 ) ); 66 66 67 68 $cmb = new_cmb2_box( array( 69 'id' => 'lc_settings', 70 'title' => __( 'Settings for this carousel', 'cmb2' ), 71 'object_types' => array( 'lorem_carousel' ), // Post type 72 'context' => 'normal', 73 'priority' => 'high', 74 'show_names' => true, // Show field names on the left 75 // 'cmb_styles' => false, // false to disable the CMB stylesheet 76 // 'closed' => true, // Keep the metabox closed by default 77 ) ); 78 79 $cmb->add_field( array( 80 'name' => 'Nav', 81 'id' => 'lc_loop', 82 'type' => 'radio_inline', 83 'options' => array( 84 '1' => __( 'Loop Carousel', 'cmb2' ), 85 '0' => __( 'Do not loop carousel', 'cmb2' ) 86 ), 87 'default' =>1 88 ) ); 89 $cmb->add_field( array( 90 'name' => 'Nav', 91 'id' => 'lc_nav', 92 'type' => 'radio_inline', 93 'options' => array( 94 '1' => __( 'Show Nav', 'cmb2' ), 95 '0' => __( 'Hide Nav', 'cmb2' ) 96 ), 97 'default' =>1 98 ) ); 99 $cmb->add_field( array( 100 'name' => 'Dots', 101 'id' => 'lc_dots', 102 'type' => 'radio_inline', 103 'options' => array( 104 '1' => __( 'Show Dots', 'cmb2' ), 105 '0' => __( 'Hide Dots', 'cmb2' ) 106 ), 107 'default' =>0, 108 'desc' => 'Hide or show the dots on navigations. Default hidden', 109 ) ); 110 111 112 67 113 } 68 114 … … 71 117 // Add Shortcode 72 118 function lorem_carousel_shortcode( $atts ) { 73 119 global $nav,$dots,$loops,$lc_id; 74 120 // Attributes 75 121 $atts = shortcode_atts( … … 82 128 83 129 130 84 131 //$text = get_post_meta( $atts->carousel_id, 'carousel_images_group', true ); 85 132 // Get the list of files 86 133 $files = get_post_meta( $atts['carousel_id'], 'carousel_images_group', 1 ); 87 134 $nav = get_post_meta( $atts['carousel_id'], 'lc_nav', 1 ); 135 $dots = get_post_meta( $atts['carousel_id'], 'lc_dots', 1 ); 136 $loops = get_post_meta( $atts['carousel_id'], 'lc_loop', 1 ); 137 $lc_id = "lorem_carousel_".$atts['carousel_id']; 88 138 89 139 $data = ""; 90 $data.= '<div class="owl-carousel owl-theme" >';140 $data.= '<div class="owl-carousel owl-theme" id="'.$lc_id.'">'; 91 141 // Loop through them and output an image 92 142 foreach ( (array) $files as $attachment_id => $attachment_url ) { … … 97 147 $data.= '</div>'; 98 148 149 function lc_js_settings() { 150 global $nav, $dots, $loops, $lc_id; 151 if ($nav == '1'){ 152 $showNav = 'true'; 153 }elseif($nav == '0'){ 154 $showNav = 'false'; 155 } 156 if ($dots == '1'){ 157 $showDots = 'true'; 158 }elseif($dots == '0'){ 159 $showDots = 'false'; 160 } 161 if($loops == '1'){ 162 $showLoop = 'true'; 163 }elseif($loops == '0'){ 164 $showLoop = 'false'; 165 } 166 ?> 167 <script type="text/javascript"> 168 jQuery(document).ready(function ($) { 169 $("#<?php echo $lc_id; ?>").owlCarousel({ 170 dots:<?php echo $showDots; ?>, 171 loop:<?php echo $showLoop; ?>, 172 margin:10, 173 nav:<?php echo $showNav; ?>, 174 items:1, 175 autoHeight:true, 176 navText: ["<strong>◀ </strong> "," <strong>▶</strong> "] 177 }); 178 179 180 }) 181 182 183 </script> 184 <?php 185 } 186 add_action( 'wp_footer', 'lc_js_settings' ); 187 99 188 100 189 return $data; -
lorem-carousel/trunk/includes/class-lorem-carousel.php
r2216641 r2218386 23 23 * version of the plugin. 24 24 * 25 * @since 1.0. 025 * @since 1.0.1 26 26 * @package Lorem_Carousel 27 27 * @subpackage Lorem_Carousel/includes -
lorem-carousel/trunk/lorem-carousel.php
r2216641 r2218386 10 10 * 11 11 * @link https://owlpixel.com 12 * @since 1.0. 012 * @since 1.0.1 13 13 * @package Lorem_Carousel 14 14 * … … 17 17 * Plugin URI: https://wpditto.com 18 18 * Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area. 19 * Version: 1. 0.019 * Version: 1.2.1 20 20 * Author: Anowar Hossen 21 21 * Author URI: https://owlpixel.com -
lorem-carousel/trunk/public/class-lorem-carousel-public.php
r2216641 r2218386 26 26 * The ID of this plugin. 27 27 * 28 * @since 1.0. 028 * @since 1.0.1 29 29 * @access private 30 30 * @var string $plugin_name The ID of this plugin. … … 35 35 * The version of this plugin. 36 36 * 37 * @since 1.0. 037 * @since 1.0.1 38 38 * @access private 39 39 * @var string $version The current version of this plugin. -
lorem-carousel/trunk/public/css/lorem-carousel-public.css
r2216641 r2218386 23 23 background-color: rgba(175, 175, 175, 0.77) !important; 24 24 } 25 .owl-carousel .owl-dots{ 26 text-align: center; 27 } 28 .owl-carousel .owl-dots button.owl-dot { 29 background-color: rgba(0, 0, 0, 0.43); 30 width: 15px; 31 height: 15px; 32 margin-left: 4px; 33 border: 2px solid rgba(0, 0, 0, 0); 34 } 35 36 .owl-dots button.owl-dot.active { 37 border: 2px solid #000000; 38 background: #3c3c3c; 39 } 40 -
lorem-carousel/trunk/public/js/lorem-carousel-public.js
r2216641 r2218386 32 32 33 33 $(document).ready(function () { 34 $(".owl-carousel").owlCarousel({35 loop:true,36 margin:10,37 nav:true,38 items:1,39 autoHeight:true,40 navText: ["<strong>◀ </strong> "," <strong>▶</strong> "]41 });42 34 43 35 $('.custom-control').on('click', 'button', function() { -
lorem-carousel/trunk/readme.txt
r2216641 r2218386 5 5 Tested up to: 5.3 6 6 License: GPLv2 or later 7 Stable Tag: 1.2.1 7 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 8 9 … … 163 164 = 1.0 = 164 165 * First Release 166 167 168 == Changelog == 169 170 = 1.0.1 – Dec 26, 2019 = 171 * New* Custom settings has been added
Note: See TracChangeset
for help on using the changeset viewer.