芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/trx_utils/widgets/calendar.php
'widget_calendar', 'description' => esc_html__('Calendar for posts and/or Events', 'trx_utils')); parent::__construct( 'lorem_ipsum_books_media_store_widget_calendar', esc_html__('Lorem Ipsum - Advanced Calendar', 'trx_utils'), $widget_ops ); } // Show widget function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : ''); $post_type = isset($instance['post_type']) ? $instance['post_type'] : 'post'; $output = lorem_ipsum_books_media_store_get_calendar(false, 0, 0, array('post_type'=>$post_type)); if (!empty($output)) { // Before widget (defined by themes) lorem_ipsum_books_media_store_show_layout($before_widget); // Display the widget title if one was input (before and after defined by themes) if ($title) lorem_ipsum_books_media_store_show_layout($title, $before_title, $after_title); lorem_ipsum_books_media_store_show_layout($output); // After widget (defined by themes) lorem_ipsum_books_media_store_show_layout($after_widget); } } // Update the widget settings. function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['post_type'] = isset($new_instance['post_type']) ? join(',', $new_instance['post_type']) : 'post'; return $instance; } // Displays the widget settings controls on the widget panel. function form($instance) { // Set up some default widget settings $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'post_type'=>'post' ) ); $title = $instance['title']; $post_type = $instance['post_type']; $posts_types = lorem_ipsum_books_media_store_get_list_posts_types(false); ?>
0) { foreach ($posts_types as $type=>$type_title) { $i++; echo '
'.($type_title).'
'; } } ?>
"", "weekdays" => "short", // Common params "id" => "", "class" => "", "css" => "" ), $atts)); if ($atts['weekdays']=='') $atts['weekdays'] = 'short'; extract($atts); $type = 'lorem_ipsum_books_media_store_widget_calendar'; $output = ''; global $wp_widget_factory; if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) { $output = '
'; ob_start(); the_widget( $type, $atts, lorem_ipsum_books_media_store_prepare_widgets_args(lorem_ipsum_books_media_store_storage_get('widgets_args'), $id ? $id.'_widget' : 'widget_calendar', 'widget_calendar') ); $output .= ob_get_contents(); ob_end_clean(); $output .= '
'; } return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_widget_calendar', $atts, $content); } add_shortcode("trx_widget_calendar", "lorem_ipsum_books_media_store_sc_widget_calendar"); } // Add [trx_widget_calendar] in the VC shortcodes list if (!function_exists('lorem_ipsum_books_media_store_widget_calendar_reg_shortcodes_vc')) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list_vc','lorem_ipsum_books_media_store_widget_calendar_reg_shortcodes_vc'); function lorem_ipsum_books_media_store_widget_calendar_reg_shortcodes_vc() { vc_map( array( "base" => "trx_widget_calendar", "name" => esc_html__("Widget Calendar", 'trx_utils'), "description" => wp_kses_data( __("Insert standard WP Calendar, but allow user select week day's captions", 'trx_utils') ), "category" => esc_html__('Content', 'trx_utils'), "icon" => 'icon_trx_widget_calendar', "class" => "trx_widget_calendar", "content_element" => true, "is_container" => false, "show_settings_on_create" => true, "params" => array( array( "param_name" => "title", "heading" => esc_html__("Widget title", 'trx_utils'), "description" => wp_kses_data( __("Title of the widget", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "weekdays", "heading" => esc_html__("Week days", 'trx_utils'), "description" => wp_kses_data( __("Show captions for the week days as three letters (Sun, Mon, etc.) or as one initial letter (S, M, etc.)", 'trx_utils') ), "class" => "", "value" => array(esc_html__("Initial letter", 'trx_utils') => "initial" ), "type" => "checkbox" ), lorem_ipsum_books_media_store_get_vc_param('id'), lorem_ipsum_books_media_store_get_vc_param('class'), lorem_ipsum_books_media_store_get_vc_param('css') ) ) ); class WPBakeryShortCode_Trx_Widget_Calendar extends WPBakeryShortCode {} } } ?>