芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/trx_utils/widgets/flickr.php
'widget_flickr', 'description' => esc_html__('Last flickr photos.', 'trx_utils') ); parent::__construct( 'lorem_ipsum_books_media_store_widget_flickr', esc_html__('Lorem Ipsum - Flickr photos', 'trx_utils'), $widget_ops ); } // Show widget function widget( $args, $instance ) { extract( $args ); $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '' ); $flickr_username = isset($instance['flickr_username']) ? $instance['flickr_username'] : ''; $flickr_count = isset($instance['flickr_count']) ? $instance['flickr_count'] : ''; // 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); // Here will be displayed widget content ?>
< type="text/javascript" src="://www.flickr.com/badge_code_v2.gne?count=&display=random&flickr_display=random&size=&layout=x&source=user&user=">> 10 images $size = 'square'; ?>< type="text/javascript" src="://www.flickr.com/badge_code.gne?count=&display=random&flickr_display=random&size=&layout=x&source=user&nsid=&raw=1">>
'', 'flickr_username' => '', 'flickr_count' => '' ); $instance = wp_parse_args( (array) $instance, $defaults ); $title = isset($instance['title']) ? $instance['title'] : ''; $flickr_username = isset($instance['flickr_username']) ? $instance['flickr_username'] : ''; $flickr_count = isset($instance['flickr_count']) ? $instance['flickr_count'] : ''; ?>
"", 'flickr_count' => 6, 'flickr_username' => '', // Common params "id" => "", "class" => "", "css" => "" ), $atts)); extract($atts); $type = 'lorem_ipsum_books_media_store_widget_flickr'; $output = ''; if ( (int) $atts['flickr_count'] > 0 && !empty($atts['flickr_username']) ) { 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_flickr', 'widget_flickr') ); $output .= ob_get_contents(); ob_end_clean(); $output .= '
'; } } return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_widget_flickr', $atts, $content); } add_shortcode("trx_widget_flickr", "lorem_ipsum_books_media_store_sc_widget_flickr"); } // Add [trx_widget_flickr] in the VC shortcodes list if (!function_exists('lorem_ipsum_books_media_store_widget_flickr_reg_shortcodes_vc')) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list_vc','lorem_ipsum_books_media_store_widget_flickr_reg_shortcodes_vc'); function lorem_ipsum_books_media_store_widget_flickr_reg_shortcodes_vc() { vc_map( array( "base" => "trx_widget_flickr", "name" => esc_html__("Widget Flickr photos", 'trx_utils'), "description" => wp_kses_data( __("Display the latest photos from Flickr account", 'trx_utils') ), "category" => esc_html__('Content', 'trx_utils'), "icon" => 'icon_trx_widget_flickr', "class" => "trx_widget_flickr", "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" => "flickr_username", "heading" => esc_html__("Flickr username", 'trx_utils'), "description" => wp_kses_data( __("Your Flickr username", 'trx_utils') ), "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "flickr_count", "heading" => esc_html__("Number of photos", 'trx_utils'), "description" => wp_kses_data( __("How many photos to be displayed?", 'trx_utils') ), "class" => "", "value" => "6", "type" => "textfield" ), 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_Flickr extends WPBakeryShortCode {} } } ?>