element for entry title. * * uses true no use false * @since 1.228 */ if ( !isset( $raindrops_use_wbr_for_title ) ) { $raindrops_use_wbr_for_title = false; } /** * * @since 1.239 */ if ( !isset( $raindrops_css_auto_include ) ) { $raindrops_css_auto_include = true; } /** * Current version of WordPress * * * $raindrops_current_data_theme_uri * $raindrops_current_data_author_uri * @since 0.965 */ $raindrops_check_wp_version = explode( '-', $wp_version ); $raindrops_wp_version = $raindrops_check_wp_version[ 0 ]; /* @since 1.103 */ $raindrops_current_data = wp_get_theme(); $raindrops_current_data_theme_uri = apply_filters( 'raindrops_theme_url', $raindrops_current_data->get( 'ThemeURI' ) ); $raindrops_current_data_author_uri = apply_filters( 'raindrops_author_url', $raindrops_current_data->get( 'AuthorURI' ) ); $raindrops_current_data_version = $raindrops_current_data->get( 'Version' ); $raindrops_current_theme_name = $raindrops_current_data->get( 'Name' ); $raindrops_current_theme_slug = str_replace( ' ', '-', $raindrops_current_theme_name ); $raindrops_current_theme_slug = sanitize_html_class( $raindrops_current_theme_slug ); $raindrops_description_for_translation = __( 'This theme can change freely fonts,layout,color scheme and header image for each post,page. The google fonts, you can use freely in the post more than 90percent of the fonts.Color scheme and layout, you can freely change from theme customizer.For more updates, please make sure to open the link of the changelog from the help tab of this theme page.Add new post, so also to help tab of edit post page has been described how to use tips, please visit', 'Raindrops' ); /** * Include the TGM_Plugin_Activation class. * * @since 1.248 */ if ( ! isset( $raindrops_recommend_plugins ) ) { $raindrops_recommend_plugins = true; } /** * Include functions about the Raindrops options panel * * * * * @since 1.238 */ if ( file_exists( get_stylesheet_directory() . '/lib/validate.php' ) ) { require_once ( get_stylesheet_directory() . '/lib/validate.php' ); } else { require_once ( get_template_directory() . '/lib/validate.php' ); } if ( !class_exists( 'raindrops_menu_create' ) ) { if ( file_exists( get_stylesheet_directory() . '/lib/option-panel.php' ) ) { require_once ( get_stylesheet_directory() . '/lib/option-panel.php' ); } else { require_once ( get_template_directory() . '/lib/option-panel.php' ); } } if ( $raindrops_show_theme_option == true ) { $is_submenu = new raindrops_menu_create; add_action( 'admin_menu', array( $is_submenu, 'raindrops_add_menus' ) ); } /** * Include functions about colors ,backgrounds and borders * * * * */ $raindrops_included_files = get_included_files(); foreach ( $raindrops_included_files as $key => $val ) { $included_file[ $key ] = basename( $val ); } $raindrops_included_files = $included_file; $raindrops_color_file_path = get_stylesheet_directory() . '/lib/csscolor/csscolor.php'; if ( !in_array( 'csscolor.php', $raindrops_included_files ) && file_exists( $raindrops_color_file_path ) ) { require_once ( $raindrops_color_file_path ); } elseif ( !in_array( 'csscolor.php', $raindrops_included_files ) ) { require_once ( get_template_directory() . '/lib/csscolor/csscolor.php' ); } $raindrops_color_file_path = get_stylesheet_directory() . '/lib/csscolor.css.php'; if ( !in_array( 'csscolor.css.php', $raindrops_included_files ) && file_exists( $raindrops_color_file_path ) ) { require_once ( $raindrops_color_file_path ); } elseif ( !in_array( 'csscolor.css.php', $raindrops_included_files ) ) { require_once ( get_template_directory() . '/lib/csscolor.css.php' ); } $raindrops_widget_path = get_stylesheet_directory() . '/lib/widgets.php'; if ( !in_array( 'widgets.php', $raindrops_included_files ) && file_exists( $raindrops_widget_path ) ) { require_once ( $raindrops_widget_path ); } elseif ( !in_array( 'widgets.php', $raindrops_included_files ) ) { require_once ( get_template_directory() . '/lib/widgets.php' ); } $jetpack_active_modules = get_option( 'jetpack_active_modules' ); if ( class_exists( 'Jetpack', false ) && $jetpack_active_modules ) { $raindrops_jetpack_path = get_stylesheet_directory() . '/lib/jetpack.php'; if ( !in_array( 'jetpack.php', $raindrops_included_files ) && file_exists( $raindrops_widget_path ) ) { require_once ( $raindrops_jetpack_path ); } elseif ( !in_array( 'jetpack.php', $raindrops_included_files ) ) { require_once ( get_template_directory() . '/lib/jetpack.php' ); } } /** Raindrops help * * * * @since 1.155 */ add_action( 'load-post.php', array( 'RaindropsPostHelp', 'init' ) ); add_action( 'load-post-new.php', array( 'RaindropsPostHelp', 'init' ) ); add_action( 'load-themes.php', array( 'RaindropsPostHelp', 'init' ) ); add_action( 'load-theme-editor.php', array( 'RaindropsPostHelp', 'init' ) ); class RaindropsPostHelp { public $tabs = array( 'raindrops-post' => array( 'title' => 'Raindrops Help' , 'content' => 'help' ), ); static public function init() { $class = __CLASS__; new $class; } public function __construct() { switch ( $GLOBALS[ 'pagenow' ] ) { case( 'theme-editor.php' ): $this->tabs = array( 'raindrops-settings-help' => array( 'title' => 'Raindrops Infomation', 'content' => 'help' ) ); add_action( "load-{$GLOBALS[ 'pagenow' ]}", array( $this, 'add_tabs_theme_editor' ), 20 ); break; case( 'themes.php' ): $this->tabs = array( 'raindrops-settings-help' => array( 'title' => 'Raindrops Infomation', 'content' => 'help' ) ); add_action( "load-{$GLOBALS[ 'pagenow' ]}", array( $this, 'add_tabs_theme' ), 20 ); break; default: add_action( "load-{$GLOBALS[ 'pagenow' ]}", array( $this, 'add_tabs' ), 20 ); break; } } public function add_tabs() { foreach ( $this->tabs as $id => $data ) { get_current_screen()->add_help_tab( array( 'id' => $id , 'title' => __( 'Raindrops Help', 'Raindrops' ) , 'content' => '

' . __( 'About Base Color related Class', 'Raindrops' ) . '

' , 'callback' => array( $this, 'prepare' ) ) ); } } public function add_tabs_theme() { foreach ( $this->tabs as $id => $data ) { get_current_screen()->add_help_tab( array( 'id' => $id , 'title' => __( 'Raindrops Theme Help', 'Raindrops' ) , 'content' => '

' . __( 'About Raindrops Theme', 'Raindrops' ) . '

' , 'callback' => array( $this, 'prepare_theme' ) ) ); } } public function add_tabs_theme_editor() { foreach ( $this->tabs as $id => $data ) { get_current_screen()->add_help_tab( array( 'id' => $id , 'title' => __( 'Raindrops CSS Help', 'Raindrops' ) , 'content' => '

' . __( 'About Raindrops CSS', 'Raindrops' ) . '

' , 'callback' => array( $this, 'prepare_theme_editor' ) ) ); } } public function prepare( $screen, $tab ) { if ( RAINDROPS_USE_AUTO_COLOR !== false ) { echo raindrops_edit_help( '' ); } else { printf( '

%1$s

', esc_html__( 'Now RAINDROPS_USE_AUTO_COLOR value false and Cannot show this help', 'Raindrops' ) ); } } public function prepare_theme( $screen, $tab ) { echo raindrops_settings_page_contextual_help(); } public function prepare_theme_editor( $screen, $tab ) { echo raindrops_editor_page_contextual_help(); } } /** * It has alias functions. * * * * */ $raindrops_functions_file_path = get_stylesheet_directory() . '/lib/alias_functions.php'; if ( !in_array( 'alias_functions.php', $raindrops_included_files ) && file_exists( $raindrops_functions_file_path ) ) { require_once ( $raindrops_functions_file_path ); } elseif ( !in_array( 'alias_functions.php', $raindrops_included_files ) ) { require_once ( get_template_directory() . '/lib/alias_functions.php' ); } /** * Functionality limited. Now testing * Current TGM Not works at multisite * @since 1.250 */ if( is_multisite() ) { $raindrops_recommend_plugins = false; } if ( is_admin() && $raindrops_recommend_plugins !== false ) { $raindrops_is_include_tgm_config = false; if ( file_exists( get_stylesheet_directory() . '/plugins/tgm-config.php' ) ) { require_once ( get_stylesheet_directory() . '/plugins/tgm-config.php' ); $raindrops_is_include_tgm_config = true; } elseif ( file_exists( get_template_directory() . '/plugins/tgm-config.php' ) ) { require_once ( get_template_directory() . '/plugins/tgm-config.php' ); $raindrops_is_include_tgm_config = true; } if ( true == $raindrops_is_include_tgm_config && file_exists( get_template_directory() . '/plugins/class-tgm-plugin-activation.php' ) ) { if ( !class_exists( 'WP_List_Table' ) ) { require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); } require_once ( get_template_directory() . '/plugins/class-tgm-plugin-activation.php' ); } add_action( 'tgmpa_register', 'raindrops_theme_register_required_plugins' ); } if ( file_exists( get_stylesheet_directory() . '/plugins/plugins-presentation.php' ) ) { require_once ( get_stylesheet_directory() . '/plugins/plugins-presentation.php' ); } else { require_once ( get_template_directory() . '/plugins/plugins-presentation.php' ); } /** * * * * @since 1.138 */ do_action( 'raindrops_include_after' ); /** * * Add enable keyboard focus * * uses true no use false * @since 1.229 */ if( raindrops_warehouse_clone( 'raindrops_disable_keyboard_focus' ) !== 'disable' && !isset( $raindrops_enable_keyboard )) { $raindrops_enable_keyboard = true; } elseif ( ! isset( $raindrops_enable_keyboard ) ) { $raindrops_enable_keyboard = false; } /* when wp_nav_menu using fallback_cb keyboard accessibility desable why menu structure issue */ $raindrops_nav_menu_nothing_check = wp_get_nav_menus(); if( empty( $raindrops_nav_menu_nothing_check ) ) { $raindrops_enable_keyboard = false; } /** * * * * * */ add_action( 'wp_enqueue_scripts', 'raindrops_add_stylesheet' ); /** * * * * * */ register_nav_menus( array( 'primary' => esc_html__( 'Primary Navigation', 'Raindrops' ), ) ); /** * Custom image header * * * * $raindrops_custom_header_args * */ if ( !isset( $raindrops_custom_header_args ) ) { $raindrops_custom_header_args = array( 'default-text-color' => 'bbbbbb', 'width' => apply_filters( 'raindrops_header_image_width', '1280' ), 'flex-width' => true, 'height' => apply_filters( 'raindrops_header_image_height', '573' ), 'flex-height' => true, 'header-text' => true, 'default-image' => '%1$s/images/headers/wp3.jpg', 'wp-head-callback' => apply_filters( 'raindrops_wp-head-callback', 'raindrops_embed_meta' ), ); if ( version_compare( $wp_version, '4.1', '<' ) ) { $raindrops_custom_header_args['admin-preview-callback'] = 'raindrops_admin_header_image'; $raindrops_custom_header_args['admin-head-callback'] = 'raindrops_admin_header_style'; } add_theme_support( 'custom-header', $raindrops_custom_header_args ); //they are "suggested" when flex-width and flex-height are set /** * Add for WordPress 4.1 * @since 1.260 */ register_default_headers( array( 'raindrops' => array( 'url' => '%s/images/headers/wp3.jpg', 'thumbnail_url' => '%s/images/headers/wp3-thumbnail.jpg', ), ) ); } /** * It has hooks. * * * * */ $raindrops_functions_file_path = get_stylesheet_directory() . '/lib/hooks.php'; if ( !in_array( 'hooks.php', $raindrops_included_files ) && file_exists( $raindrops_functions_file_path ) ) { require_once ( $raindrops_functions_file_path ); } elseif ( !in_array( 'alias_functions.php', $raindrops_included_files ) ) { require_once ( get_template_directory() . '/lib/hooks.php' ); } /** * Accessibility Settings * * When true * Add to hidden text for identify entry-title link text, comment link text, more link * * @since 1.116 */ function raindrops_extend_query( $vars ) { $vars[] = 'raindrops_color_type'; return $vars; } if ( !isset( $raindrops_link_unique_text ) ) { if ( 'yes' == raindrops_warehouse_clone( 'raindrops_accessibility_settings' ) ) { $raindrops_link_unique_text = true; } else { $raindrops_link_unique_text = false; } } /** * Enabling accessibility links when Setting value no at Raindrops options page Accessibility Settings * * * @since1.217 */ if ( !isset( $raindrops_accessibility_link ) ) { $raindrops_accessibility_link = true; } if ( 'yes' == raindrops_warehouse_clone( 'raindrops_accessibility_settings' ) ) { $raindrops_accessibility_link = false; } if ( ! function_exists( 'raindrops_current_url' ) ) { function raindrops_current_url() { $url = 'http'; if ( isset( $_SERVER[ "HTTPS" ] ) && $_SERVER[ "HTTPS" ] == "on" ) { $url .= "s"; } $url .= "://"; if ( isset( $_SERVER[ "SERVER_PORT" ] ) && $_SERVER[ "SERVER_PORT" ] != "80" ) { $url .= $_SERVER[ "SERVER_NAME" ] . ":" . $_SERVER[ "SERVER_PORT" ] . $_SERVER[ "REQUEST_URI" ]; } else { $url .= $_SERVER[ "SERVER_NAME" ] . $_SERVER[ "REQUEST_URI" ]; } $url = esc_url( $url ); return apply_filters( 'raindrops_current_url', $url ); } } /** * home link * * ver 1.116 default value change * if you need home link then $raindrops_nav_menu_home_link set true. */ if ( !isset( $raindrops_nav_menu_home_link ) ) { if ( true == $raindrops_link_unique_text ) { $raindrops_nav_menu_home_link = false; } else { $raindrops_nav_menu_home_link = true; } } /** * browser detection * use server side browser detection or javascript browser ditection * * javascript browser ditection is At a target [ operate / even when cash plug-in is used / properly ] * value bool * $raindrops_browser_detection * ver 1.121 */ if ( !isset( $raindrops_browser_detection ) ) { $raindrops_browser_detection = false; } /** * HTML document type * * * * Now only 'xhtml' * ver 0.999 add type 'html5' */ if ( !isset( $raindrops_document_type ) ) { if ( 'xhtml' == raindrops_warehouse_clone( 'raindrops_doc_type_settings' ) ) { $raindrops_document_type = 'xhtml'; } else { $raindrops_document_type = 'html5'; } } /** * Force Document type for lt IE9 Old Browser * Note: This setting is SERVER_SIDE Setting, I recommend that the browser is set when the cache of less than IE9 as not performed * * Raindrops 1.204 remove from header.php * * * * ver 1.204 */ if ( $is_IE ) { preg_match( "|(MSIE )([0-9]{1,2})(\.)|si", $_SERVER[ 'HTTP_USER_AGENT' ], $raindrops_regs ); if ( isset( $raindrops_regs[ 2 ] ) && $raindrops_regs[ 2 ] < 9 ) { $raindrops_document_type = 'xhtml'; } } /** * * * $raindrops_post_formats_args * add ver0.991 gallery,status */ if ( !isset( $raindrops_post_formats_args ) ) { $raindrops_post_formats_args = array( 'aside', 'gallery', 'chat', 'link', 'image', 'status', 'quote', 'video' ); add_theme_support( 'post-formats', $raindrops_post_formats_args ); } /** * * * * $raindrops_custom_background_args * */ if ( !isset( $raindrops_custom_background_args ) ) { $raindrops_custom_background_args = array( 'default-color' => '', 'default-image' => '', //'wp-head-callback' => apply_filters( 'raindrops_wp-head-callback', 'raindrops_embed_meta' ) ); add_theme_support( 'custom-background', $raindrops_custom_background_args ); } /** * * * * $raindrops_post_thumbnails_args * */ if ( !isset( $raindrops_post_thumbnails_args ) ) { $raindrops_post_thumbnails_args = array( 'post', 'page' ); add_theme_support( 'post-thumbnails', $raindrops_post_thumbnails_args ); } /** * * * * * */ add_theme_support( 'automatic-feed-links' ); /** * Your extend function , settings write below. * * * * */ /** * Original page width implementation by manual labor * * If you need original page width * you can specific pixel page width * e.g. '$raindrops_page_width = '776';' is 776px page width. * * */ if ( !isset( $raindrops_page_width ) ) { $raindrops_page_width = ''; } /** * Content width implementation by manual labor * * If you need specific $content_width. * value set 400 When not setting or empty. * */ //$content_width = ''; /** * 750px,950px centered layout fluid or fixed page width switch * * Empty value makes like a Elastic layout * * value 'fixed' or empty * */ if ( !isset( $raindrops_fluid_or_fixed ) ) { $raindrops_fluid_or_fixed = 'fixed'; } /** * fluid page main column minimum width px * * * * $raindrops_fluid_minimum_width * */ if ( !isset( $raindrops_fluid_minimum_width ) ) { $raindrops_fluid_minimum_width = '320'; } /** * $raindrops_fluid_minimum_width for IE * * IE browser not support responsive * * $raindrops_fluid_minimum_width * */ if ( $is_IE ) { preg_match( "|(MSIE )([0-9]{1,2})(\.)|si", $_SERVER[ 'HTTP_USER_AGENT' ], $regs ); if ( isset( $regs[ 2 ] ) && $regs[ 2 ] < 9 ) { $raindrops_fluid_minimum_width = '640'; } } /** * fluid page main column maximum width px * * * * $raindrops_fluid_maximum_width * */ if ( !isset( $raindrops_fluid_maximum_width ) ) { $raindrops_fluid_maximum_width = raindrops_warehouse_clone( 'raindrops_fluid_max_width' ); } /** * Special simple view for mobile and small width browser * If it sets to true, a display simple compulsory always will be performed. * * default false * $raindrops_fallback_human_interface_show * */ if ( !isset( $raindrops_fallback_human_interface_show ) ) { $raindrops_fallback_human_interface_show = false; } /** * Raindrops header and footer image upload * * $raindrops_max_width * $raindrops_max_upload_size * $raindrops_allow_file_type * */ // Allow image type Raindrops footer and header. if ( !isset( $raindrops_allow_file_type ) ) { $raindrops_allow_file_type = array( 'image/png', 'image/jpeg', 'image/jpg', 'image/gif' ); } //max upload size byte if ( !isset( $raindrops_max_upload_size ) ) { $raindrops_max_upload_size = 2000000; } //header or footer image max width px if ( !isset( $raindrops_max_width ) ) { $raindrops_max_width = 1300; } /** * Custom fields name css is add to post style rules. * * When false add to style single post and pages * When true add to style all list style posts and pages * RAINDROPS_OVERRIDE_POST_STYLE_ALL_CONTENTS * @since 0.992 */ if ( !defined( 'RAINDROPS_OVERRIDE_POST_STYLE_ALL_CONTENTS' ) ) { define( "RAINDROPS_OVERRIDE_POST_STYLE_ALL_CONTENTS", true ); } /** * * * * RAINDROPS_SHOW_DELETE_POST_LINK * */ if ( !defined( 'RAINDROPS_SHOW_DELETE_POST_LINK' ) ) { define( "RAINDROPS_SHOW_DELETE_POST_LINK", false ); } /** * the_content( ) or the_excerpt * * the_excerpt use where index,archive,other not single pages. * If RAINDROPS_USE_LIST_EXCERPT value false and use the_content . * * RAINDROPS_USE_LIST_EXCERPT * add ver 1.127 * When use excerpt please set $raindrops_where_excerpts */ if ( !defined( 'RAINDROPS_USE_LIST_EXCERPT' ) ) { define( "RAINDROPS_USE_LIST_EXCERPT", true ); } // values 'is_search', 'is_archive', 'is_category' ,'is_tax', 'is_tag' any conditional function name /** * * * * @since 1.127 */ if ( !function_exists( 'raindrops_detect_display_none_condition' ) ) { function raindrops_detect_display_none_condition() { global $raindrops_where_display_none; if ( !isset( $raindrops_where_display_none ) ) { $raindrops_display_none_pages = array(); if ( raindrops_warehouse_clone( 'raindrops_entry_content_is_home' ) == 'none' ) { $raindrops_display_none_pages[] = 'is_home'; } if ( raindrops_warehouse_clone( 'raindrops_entry_content_is_category' ) == 'none' ) { $raindrops_display_none_pages[] = 'is_category'; } if ( raindrops_warehouse_clone( 'raindrops_entry_content_is_search' ) == 'none' ) { $raindrops_display_none_pages[] = 'is_search'; } $raindrops_where_display_none = $raindrops_display_none_pages; } if ( !empty( $raindrops_where_display_none ) && is_array( $raindrops_where_display_none ) ) { foreach ( $raindrops_where_display_none as $excerpt ) { if ( true == $excerpt() ) { return true; } } } return false; } } if ( !function_exists( 'raindrops_detect_excerpt_condition' ) ) { function raindrops_detect_excerpt_condition() { global $raindrops_where_excerpts, $post; if ( !isset( $raindrops_where_excerpts ) ) { $raindrops_excerpt_pages = array(); if ( raindrops_warehouse_clone( 'raindrops_entry_content_is_home' ) == 'excerpt' ) { $raindrops_excerpt_pages[] = 'is_home'; } if ( raindrops_warehouse_clone( 'raindrops_entry_content_is_category' ) == 'excerpt' ) { $raindrops_excerpt_pages[] = 'is_category'; } if ( raindrops_warehouse_clone( 'raindrops_entry_content_is_search' ) == 'excerpt' ) { $raindrops_excerpt_pages[] = 'is_search'; } $raindrops_where_excerpts = $raindrops_excerpt_pages; } if ( RAINDROPS_USE_LIST_EXCERPT !== true ) { return false; } if ( !empty( $raindrops_where_excerpts ) ) { foreach ( $raindrops_where_excerpts as $excerpt ) { if ( true == $excerpt() ) { return true; } } } return false; } } /** * Auto Color On or Off * If you want no Auto Color when set value false. * * * RAINDROPS_USE_AUTO_COLOR * */ if ( !defined( 'RAINDROPS_USE_AUTO_COLOR' ) ) { define( "RAINDROPS_USE_AUTO_COLOR", true ); } /** * Monthly archive, Daily archive time format * * * * * */ if ( !defined( 'RAINDROPS_TABLE_TITLE' ) ) { define( "RAINDROPS_TABLE_TITLE", 'options' ); } if ( !defined( 'RAINDROPS_PLUGIN_TABLE' ) ) { define( 'RAINDROPS_PLUGIN_TABLE', $wpdb->prefix . RAINDROPS_TABLE_TITLE ); } if ( !isset( $raindrops_theme_settings ) ) { $raindrops_theme_settings = get_option( 'raindrops_theme_settings', 'no' ); } /** * single-post-thumbnail * * * RAINDROPS_SINGLE_POST_THUMBNAIL_WIDTH * RAINDROPS_SINGLE_POST_THUMBNAIL_HEIGHT * */ if ( !isset( $raindrops_featured_image_full_size ) ) { $raindrops_featured_image_full_size = true; } if ( !defined( 'RAINDROPS_SINGLE_POST_THUMBNAIL_WIDTH' ) ) { define( 'RAINDROPS_SINGLE_POST_THUMBNAIL_WIDTH', 600 ); } if ( !defined( 'RAINDROPS_SINGLE_POST_THUMBNAIL_HEIGHT' ) ) { define( 'RAINDROPS_SINGLE_POST_THUMBNAIL_HEIGHT', 200 ); } add_image_size( 'single-post-thumbnail', RAINDROPS_SINGLE_POST_THUMBNAIL_WIDTH, RAINDROPS_SINGLE_POST_THUMBNAIL_HEIGHT, true ); /** * * * RAINDROPS_USE_FEATURED_IMAGE_LIGHT_BOX * @since 1.002 */ if ( !defined( 'RAINDROPS_USE_FEATURED_IMAGE_LIGHT_BOX' ) ) { define( 'RAINDROPS_USE_FEATURED_IMAGE_LIGHT_BOX', false ); } /** * widget settings * * Registered Default Sidebar, Extra Sidebar, Sticky Widget, Footer Widget, Category Blog Widget * * @since 1.119 Widget label change from Category Blog Widget to Status Sidebar * */ if ( !function_exists( 'raindrops_widgets_init' ) ) { function raindrops_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Default Sidebar', 'Raindrops' ), 'id' => 'sidebar-1', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', 'widget_id' => 'default', 'widget_name' => 'default', 'text' => "1" ) ); register_sidebar( array( 'name' => esc_html__( 'Extra Sidebar', 'Raindrops' ), 'id' => 'sidebar-2', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', 'widget_id' => 'extra', 'widget_name' => 'extra', 'text' => "2" ) ); register_sidebar( array( 'name' => esc_html__( 'Sticky Widget', 'Raindrops' ), 'id' => 'sidebar-3', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', 'widget_id' => 'toppage2', 'widget_name' => 'toppage2', 'text' => "3" ) ); register_sidebar( array( 'name' => esc_html__( 'Footer Widget', 'Raindrops' ), 'id' => 'sidebar-4', 'before_widget' => '', 'before_title' => '', 'widget_id' => 'footer', 'widget_name' => 'footer', 'text' => "4" ) ); register_sidebar( array( 'name' => esc_html__( 'Post Format Status Sidebar', 'Raindrops' ), 'id' => 'sidebar-5', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', 'widget_id' => 'categoryblog', 'widget_name' => 'categoryblog', 'text' => "5" ) ); } } /** * * * * * */ if ( !isset( $raindrops_base_setting ) ) { $raindrops_base_setting = $raindrops_base_setting_args; } /** * * * * * @since 1.238 */ if ( isset( $raindrops_base_font_size ) ) { raindrops_update_theme_option( 'raindrops_basefont_settings', $raindrops_base_font_size ); } if ( raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) == 'hide' ) { $rsidebar_show = false; } else { $rsidebar_show = true; } if ( !isset( $raindrops_current_style_type ) ) { $raindrops_current_style_type = raindrops_warehouse_clone( "raindrops_style_type" ); } /** * Content width setup * * * * * */ if ( !isset( $content_width ) || empty( $content_width ) ) { $content_width = raindrops_content_width_clone(); } /** * * * * * */ $install_once = get_option( 'raindrops_theme_settings' ); if ( false == $install_once || !array_key_exists( 'install', $install_once ) ) { //add_action( 'admin_init', 'setup_raindrops' ); } add_action( 'widgets_init', 'raindrops_widgets_init' ); /** * Add option helper * * * * * */ foreach ( $raindrops_base_setting as $setting ) { $function_name = $setting[ 'option_name' ] . '_validate'; if ( !function_exists( $function_name ) ) { $message = sprintf( esc_html__( 'If you add %s when you must create function %s for data validation', 'Raindrops' ), $setting[ 'option_name' ], $function_name ); printf( '', $message ); return; } } /** * Extend body_class( ) * * * add browser class, languages class, * * */ if ( !function_exists( 'raindrops_add_body_class' ) ) { function raindrops_add_body_class( $classes ) { global $post, $current_blog, $raindrops_link_unique_text, $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone, $raindrops_browser_detection, $raindrops_status_bar, $raindrops_enable_keyboard; $classes[] = get_locale(); if ( $raindrops_enable_keyboard == true && true !== $raindrops_link_unique_text ) { $classes[] = 'enable-keyboard'; } if ( is_single() || is_page() ) { $raindrops_options = get_option( "raindrops_theme_settings" ); if ( isset( $raindrops_options[ "raindrops_style_type" ] ) && !empty( $raindrops_options[ "raindrops_style_type" ] ) ) { $color_type = "rd-type-" . $raindrops_options[ "raindrops_style_type" ]; } $raindrops_content_check = get_post( $post->ID ); $raindrops_content_check = $raindrops_content_check->post_content; if ( preg_match( "!\[raindrops[^\]]+(color_type)=(\"|')*?([^\"' ]+)(\"|' )*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) { $color_type = "rd-type-" . trim( $regs[ 3 ] ); } if ( preg_match( "!\[raindrops[^\]]+(col)=(\"|')*?([^\"' ]+)(\"|')*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) { $color_type .= ' '; $color_type .= "rd-col-" . $regs[ 3 ]; } if ( !isset( $color_type ) ) { // When not using database $color_type = "rd-type-" . raindrops_warehouse( 'raindrops_style_type' ); } $classes[] = $color_type; } else { $raindrops_options = get_option( "raindrops_theme_settings" ); if ( isset( $raindrops_options[ "raindrops_style_type" ] ) && !empty( $raindrops_options[ "raindrops_style_type" ] ) ) { $classes[] = "rd-type-" . $raindrops_options[ "raindrops_style_type" ]; } else { $classes[] = "rd-type-" . raindrops_warehouse( 'raindrops_style_type' ); } } if ( true == $raindrops_browser_detection ) { if ( isset( $_SERVER[ "HTTP_ACCEPT_LANGUAGE" ] ) ) { $browser_lang = $_SERVER[ "HTTP_ACCEPT_LANGUAGE" ]; $browser_lang = explode( ",", $browser_lang ); $browser_lang = esc_html( $browser_lang[ 0 ] ); $browser_lang = 'accept-lang-' . $browser_lang; $classes[] = $browser_lang; } switch ( true ) { case ( $is_lynx ): $classes[] = 'lynx'; break; case ( $is_gecko ): if ( preg_match( '!Trident/.*rv:([0-9]{1,}\.[\.0-9]{0,})!', $_SERVER[ 'HTTP_USER_AGENT' ], $regs ) ) { $classes[] = 'ie' . (int) $regs[ 1 ]; } else { $classes[] = 'gecko'; } break; case ( $is_IE ): preg_match( "|(MSIE )([0-9]{1,2})(\.)|si", $_SERVER[ 'HTTP_USER_AGENT' ], $regs ); if ( isset( $regs[ 2 ] ) ) { $classes[] = 'ie' . $regs[ 2 ]; } break; case ( $is_opera ): $classes[] = 'opera'; break; case ( $is_NS4 ): $classes[] = 'ns4'; break; case ( $is_safari ): $classes[] = 'safari'; break; case ( $is_chrome ): $classes[] = 'chrome'; break; case ( $is_iphone ): $classes[] = 'iphone'; break; default: $classes[] = 'unknown2'; break; } } if ( isset( $current_blog ) ) { $classes[] = "b" . absint( $current_blog->blog_id ); } if ( true == $raindrops_link_unique_text ) { $classes[] = 'raindrops-accessible-mode'; } if ( $raindrops_status_bar == true ) { $classes[] = 'raindrops-status-bar-active'; } return apply_filters( "raindrops_add_body_class", $classes ); } } /** * wp_list_comments callback function * * * * comments.php * */ if ( !function_exists( 'raindrops_comment' ) ) { function raindrops_comment( $comment, $args, $depth ) { $GLOBALS[ 'comment' ] = $comment; if ( '' == $comment->comment_type ) { ?>
  • id="li-comment-">
    %2$s', sprintf( '%s ', get_comment_author_link() ), esc_html__( 'says:', 'Raindrops' ) ); ?>
    comment_approved ) { ?>

    comment_ID ); comment_reply_link( array_merge( $args, array( 'reply_text' => $raindrops_comment_reply_text, 'depth' => $depth, 'max_depth' => $args[ 'max_depth' ] ) ) ); ?>
  • comment_ID ), ' ' ); ?>

    ID ); $tag_list = get_the_tag_list( '', ' ' ); if ( false === $format ) { if ( $tag_list ) { $posted_in = '' . esc_html__( 'This entry was posted in', 'Raindrops' ) . ' %1$s ' . esc_html__( 'and tagged', 'Raindrops' ) . ' %2$s'; } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { $posted_in = '' . esc_html__( 'This entry was posted in', 'Raindrops' ) . ' %1$s '; } else { $posted_in = ''; } $result = $format . sprintf( $posted_in, get_the_category_list( ' ' ), $tag_list ); echo apply_filters( "raindrops_posted_in", $result ); } else { if ( $tag_list ) { $posted_in = '' . esc_html__( 'This entry was posted in', 'Raindrops' ) . ' %1$s ' . esc_html__( 'and tagged', 'Raindrops' ) . ' %2$s ' . ' %4$s %5$s'; } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { $posted_in = '' . esc_html__( 'This entry was posted in', 'Raindrops' ) . ' %1$s %2$s' . ' %4$s %5$s'; } else { $posted_in = ' %4$s %5$s'; } $result = sprintf( $posted_in, get_the_category_list( ' ' ), $tag_list, esc_url( get_post_format_link( $format ) ), esc_html( 'Format', 'Raindrops' ), get_post_format_string( $format ) ); echo apply_filters( "raindrops_posted_in", $result ); } } } /** * Template function raindrops_comments_link * * * * loop.php * @since 1.163 */ if ( !function_exists( 'raindrops_comments_link' ) ) { function raindrops_comments_link() { if ( comments_open() ) { $raindrops_comment_html = '%2$s %3$s'; if ( get_comments_number() > 0 ) { $raindrops_comment_string = _n( 'Comment', 'Comments', get_comments_number(), 'Raindrops' ) . raindrops_link_unique( 'Post', get_the_ID() ); $raindrops_comment_number = get_comments_number(); } else { $raindrops_comment_string = __( 'Comment ', 'Raindrops' ) . raindrops_link_unique( 'Post', get_the_ID() ); $raindrops_comment_number = ''; } } else { $raindrops_comment_html = ''; $raindrops_comment_string = ''; $raindrops_comment_number = ''; } $result = sprintf( $raindrops_comment_html, get_comments_link(), $raindrops_comment_number, $raindrops_comment_string ); return apply_filters( 'raindrops_comments_link', $result, get_comments_link(), $raindrops_comment_number, $raindrops_comment_string ); } } /** * Template function posted_on * * * * loop.php * */ if ( !function_exists( 'raindrops_posted_on' ) ) { function raindrops_posted_on() { global $post; $raindrops_date_format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' ); $author = raindrops_blank_fallback( get_the_author(), 'Somebody' ); $archive_year = get_the_time( 'Y' ); $archive_month = get_the_time( 'm' ); $archive_day = get_the_time( 'd' ); $day_link = esc_url( get_day_link( $archive_year, $archive_month, $archive_day ) . '#post-' . $post->ID ); $result = sprintf( esc_html__( '%1$s %5$s %2$s %6$s %3$s %4$s', 'Raindrops' ), '', '' . sprintf( '<%4$s class="entry-date updated" %5$s>%3$s', $day_link, esc_attr( 'archives daily ' . get_the_time( $raindrops_date_format ) ), get_the_date( $raindrops_date_format ), raindrops_doctype_elements( 'span', 'time', false ), raindrops_doctype_elements( '', 'datetime="' . esc_attr( get_the_date( 'c' ) ) . '"', false ) ) . '', '' . sprintf( '%3$s ', get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'Raindrops' ), wp_kses( $author, array() ) ), $author ), apply_filters( 'raindrops_posted_on_comment_link', raindrops_comments_link() ), '' . __( 'Posted on', 'Raindrops' ) . '', '' . __( 'by', 'Raindrops' ) . '' ); $format = get_post_format(); $content_empty_check = ''; if ( isset( $post ) ) { $content_empty_check = trim( get_the_content() ); } if ( false === $format ) { echo apply_filters( "raindrops_posted_on", $result ); } elseif ( empty( $content_empty_check ) ) { echo raindrops_comments_link(); } else { echo apply_filters( "raindrops_posted_on", $result ); } } } /** * Special custom fields key css, javascript, metatags * * * css,javascrip,meta is separated anothor Custom Field. * * */ if ( !function_exists( 'raindrops_filter_explode_meta_keys' ) ) { function raindrops_filter_explode_meta_keys( $content, $key ) { $explode_keys = array( 'css', 'javascript', 'meta' ); if ( in_array( $key, $explode_keys ) ) { return; } else { return $content; } } } /** * Like a get_option( ) * * * Raindrops conditional response. * * for templates */ if ( !function_exists( 'raindrops_warehouse' ) ) { function raindrops_warehouse( $name ) { return apply_filters( "raindrops_warehouse", raindrops_warehouse_clone( $name ) ); } } /** * Return $raindrops_base_setting value. * * * * * */ if ( !function_exists( 'raindrops_admin_meta' ) ) { function raindrops_admin_meta( $name, $meta_name ) { global $raindrops_base_setting; global $raindrops_page_width; $vertical = array(); foreach ( $raindrops_base_setting as $key => $val ) { if ( !is_null( $raindrops_base_setting ) ) { $vertical[] = $val[ 'option_name' ]; } } $row = array_search( $name, $vertical ); return $raindrops_base_setting[ $row ][ $meta_name ]; } } /** * Admin Panel help * * * * * */ if ( !function_exists( 'raindrops_settings_page_contextual_help' ) ) { function raindrops_settings_page_contextual_help() { global $raindrops_current_data; $html = '
    %1$s
    %2$s
    '; $link = '%2$s'; $content = ''; /* theme URI */ $content .= sprintf( $html, esc_html__( 'Theme URI', 'Raindrops' ), sprintf( $link, $raindrops_current_data->get( 'ThemeURI' ), $raindrops_current_data->get( 'ThemeURI' ), 'target="_self"' ) ); /* AuthorURI */ $content .= sprintf( $html, esc_html__( 'Author', 'Raindrops' ), sprintf( $link, $raindrops_current_data->get( 'AuthorURI' ), $raindrops_current_data->get( 'Author' ), 'target="_self"' ) ); /* Support */ $content .= sprintf( $html, esc_html__( 'Support', 'Raindrops' ), sprintf( $link, 'http://wordpress.org/support/theme/raindrops', esc_html__( 'http://wordpress.org/support/theme/raindrops', 'Raindrops' ), 'target="_blank"' ) . '
    ' . sprintf( $link, 'http://ja.forums.wordpress.org/', esc_html__( 'http://ja.forums.wordpress.org/ lang:Japanese', 'Raindrops' ), 'target="_blank"' ) ); /* Version */ $content .= sprintf( $html, esc_html__( 'Version', 'Raindrops' ), $raindrops_current_data->get( 'Version' ) ); /* Changelog.txt */ $content .= sprintf( $html, esc_html__( 'Change log text', 'Raindrops' ), sprintf( $link, get_template_directory_uri() . '/changelog.txt', esc_html__( 'Changelog , display new window', 'Raindrops' ), 'target="_blank"' ), 'target = "_blank"' ); /* readme.txt */ $content .= sprintf( $html, esc_html__( 'Readme text', 'Raindrops' ), sprintf( $link, get_template_directory_uri() . '/README.txt', esc_html__( 'Readme , display new window', 'Raindrops' ), 'target="_blank"' ) ); $content = '
    ' . $content . '
    '; return $content; } } if ( !function_exists( 'raindrops_editor_page_contextual_help' ) ) { function raindrops_editor_page_contextual_help() { global $raindrops_current_data; $html = '
    %1$s
    %2$s
    '; $link = '%2$s'; $content = ''; $content .= sprintf( $html, esc_html__( 'Support', 'Raindrops' ), sprintf( $link, 'http://wordpress.org/support/theme/raindrops', esc_html__( 'English', 'Raindrops' ), 'target="_blank"' ) . '
    ' . sprintf( $link, 'http://ja.forums.wordpress.org/', esc_html__( 'Japanese', 'Raindrops' ), 'target="_blank"' ) ); $help = '

    ' . esc_html__( 'How to remove Site Title Block', 'Raindrops' ) . '

    #hd{display:none;}
    '; $help .= '

    ' . esc_html__( 'How to remove Post Author Name', 'Raindrops' ) . '

    .posted-by-string,.author{display:none;}
    '; $help .= '

    ' . esc_html__( 'How to remove Entry Date', 'Raindrops' ) . '

    .posted-on-string,.entry-date{display:none;}
    '; $help .= '

    ' . esc_html__( 'How to remove Entry Meta', 'Raindrops' ) . '

    .entry-meta{display:none;}
    '; $help .= '

    ' . esc_html__( 'How to remove Archive Title Label[ like Category Archives ]', 'Raindrops' ) . '

    #archives-title .label{display:none;}
    '; $help .= '

    ' . esc_html__( 'How to remove Home list above next prev navigation link', 'Raindrops' ) . '

     #nav-above{ display:none;}
    '; $help .= '

    ' . esc_html__( 'above codes paste style.css last. If not change when Version value change ( line:9 )', 'Raindrops' ) . '

    '; $help = wpautop( $help ); $content = '
    ' . $content . $help . '
    '; return $content; } } /** * Raindrops edit help * * * Check the real color of the Cradation Class and the Color Class. * * */ if ( !function_exists( 'raindrops_edit_help' ) ) { function raindrops_edit_help( $text, $force = false ) { global $post_type_object; global $title; if ( RAINDROPS_USE_AUTO_COLOR !== true && $force !== true ) { return $text; } if ( ( isset( $post_type_object ) && ( $title == $post_type_object->labels->add_new_item || $title == $post_type_object->labels->edit_item ) || true == $force ) ) { $result = "

    " . esc_html__( 'Tips', "Raindrops" ) . '

    '; $result .= '

    ' . esc_html__( 'If Raindrops Options panel is opened, and the reference color is set, this arrangement of color is changed at once.', "Raindrops" ) . "

    "; $result .= "

    " . esc_html__( 'Dinamic Color Class', 'Raindrops' ) . '

    '; $result .= '
    class color5 class color4 class color3 class color2 class color1
    class color-1 class color-2 class color-3 class color-4 class color-5
    ' . esc_html__( 'code example:please HTML editor mode', 'Raindrops' ) . '
    <div class="color3"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</div>
    '; $result .= "

    " . esc_html__( 'Dinamic Gradient Class', 'Raindrops' ) . '

    '; $result .= '
    class gradient1 class gradient2 class gradient3 class gradient4
    class gradient-1 class gradient-2 class gradient-3 class gradient-4
    ' . esc_html__( 'code example:please HTML editor mode', 'Raindrops' ) . '
    <div class="gradient3">

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    </div>
    '; $result .= "

    " . esc_html__( 'Font Size CSS Class', 'Raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'Classes', 'Raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'f10 , f11 , f12 , f13 , f14 , f15 , f16 , f17 , f18 , f19 , f20 , f21 , f22 , f23 , f24 , f25 , f26', 'Raindrops' ) . "

    <p class=\"f16\">Font Size 16px</p>
    "; $result .= "
    "; $result .= "

    " . esc_html__( 'Google Fonts Family CSS Class', 'Raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'Classes', 'Raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'Note: More than 90% of the Google font can be used, but there are some limitations.', 'Raindrops' ) . "

    "; $result .= "

    " . esc_html__( 'Examples of the no corresponding font', 'Raindrops' ) . "

    Open Sans Condensed ( font name has 2 or more spaces ) 
    "; $result .= "

    " . esc_html__( 'Examples of the corresponding font', 'Raindrops' ) . "

    Open Sans Condensed ( font name has 1 or no spaces ) 
    "; $result .= "

    " . esc_html__( 'How to specify the font', 'Raindrops' ) . "

    Open Sans: <p class=\"google-font-open-sans\">Open Sans</p>
    "; $result .= "

    " . esc_html__( 'Add prefix google-font- + Font name lowercase and change to - the space', 'Raindrops' ) . "

    "; $result .= "

    " . esc_html__( 'How to specify the font weight', 'Raindrops' ) . "

    Open Sans EXTRA-BOLD800: <p class=\"google-font-open-sans800\">Open Sans</p>
    "; $result .= "

    " . esc_html__( 'How to specify the font style', 'Raindrops' ) . "

    Open Sans EXTRA-BOLD800 Italic: <p class=\"google-font-open-sans800i\">Open Sans</p>
    "; $result .= "
    "; $result .= "

    " . esc_html__( 'Example of Custom CSS Meta Box Style Rules', 'Raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'Styling Entry Title', 'Raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'Change entry title color', 'Raindrops' ) . "

    .entry-title span{ color:red; }
    "; $result .= "

    " . esc_html__( 'Styling Posted on', 'Raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'hide posted on from all post', 'Raindrops' ) . "

     .posted-on, .entry-meta-default{ display:none;}
    "; $result .= "

    " . esc_html__( 'Styling Posted in', 'Raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'hide posted in', 'Raindrops' ) . "

     .entry-meta{ display:none;}
    "; $result .= "

    " . esc_html__( 'Styling Article', 'Raindrops' ) . '

    '; $result .= "

    " . esc_html__( 'add border and padding', 'Raindrops' ) . "

     {border:1px solid red;padding:1em;}
    " . "

    " . esc_html__( 'note:Needs space { before or /*article*/ { style rules }', 'Raindrops' ) . "

    "; $result .= "
    "; $result .= $text; return $result; } else { return $text; } } } /** * Create admin panel form and define input value. * * * * */ if ( !function_exists( 'raindrops_options_init' ) ) { function raindrops_options_init() { global $raindrops_base_setting; if ( isset( $raindrops_base_setting ) ) { foreach ( $raindrops_base_setting as $setting ) { register_setting( 'raindrop_options', $setting[ 'option_name' ], $setting[ 'validate' ] ); } } } } /** * internal function File upload * * * @param $embed string inline or external or embed * @param $id #hd or #ft */ if ( !function_exists( 'raindrops_upload_image_parser' ) ) { function raindrops_upload_image_parser( $uri, $embed = "inline", $id = "#hd" ) { /* upload image from raindrops admin panel saved filename * e.g. raindrops-item-header-style-no-repeat-top-0-left-0-aomoriken.jpg * filename parse and create style */ $upload_info = wp_upload_dir(); $filename = basename( $uri ); if ( file_exists( get_stylesheet_directory() . '/images/' . $filename ) ) { if ( '#hd' == $id ) { if ( !file_exists( $upload_info[ 'path' ] . '/' . $filename ) ) { return apply_filters( 'raindrops_upload_image_parser_hd', 'background:url( ' . get_stylesheet_directory_uri() . '/images/' . $filename . ' );background-repeat:repeat-x;' ); } } elseif ( '#ft' == $id ) { if ( !file_exists( $upload_info[ 'path' ] . '/' . $filename ) ) { return apply_filters( 'raindrops_upload_image_parser_ft', 'background:url( ' . get_stylesheet_directory_uri() . '/images/' . $filename . ' );background-repeat:repeat-x;' ); } } } elseif ( file_exists( get_template_directory() . '/images/' . $filename ) ) { if ( '#hd' == $id ) { if ( !file_exists( $upload_info[ 'path' ] . '/' . $filename ) ) { return apply_filters( 'raindrops_upload_image_parser_hd', 'background:url( ' . get_template_directory_uri() . '/images/' . $filename . ' );background-repeat:repeat-x;' ); } } elseif ( '#ft' == $id ) { if ( !file_exists( $upload_info[ 'path' ] . '/' . $filename ) ) { return apply_filters( 'raindrops_upload_image_parser_ft', 'background:url( ' . get_template_directory_uri() . '/images/' . $filename . ' );background-repeat:repeat-x;' ); } } } if ( file_exists( $upload_info[ 'path' ] . '/' . $filename ) ) { $top = ''; $left = ''; $height = ''; $style = ''; preg_match( "|raindrops-item-([^-]+)|", $filename, $regs ); if ( isset( $regs[ 1 ] ) ) { $purpose = $regs[ 1 ]; $purpose = str_replace( array( "header", "footer" ), array( "#hd", "#ft" ), $purpose ); } preg_match( "|-style-([^-]+)|", $filename, $regs ); if ( isset( $regs[ 1 ] ) ) { $style = $regs[ 1 ]; $style = str_replace( array( 'no', 'x' ), array( 'no-', '-x' ), $style ); } preg_match( "|-top-(-?[^-]+)|", $filename, $regs ); if ( isset( $regs[ 1 ] ) ) { $top = $regs[ 1 ]; } preg_match( "|-left-(-?[^-]+)|", $filename, $regs ); if ( isset( $regs[ 1 ] ) ) { $left = $regs[ 1 ]; } preg_match( "|-height-([^-]+)|", $filename, $regs ); if ( isset( $regs[ 1 ] ) ) { $height = $regs[ 1 ]; } if ( 'inline' == $embed ) { return apply_filters( 'raindrops_upload_image_parser_prop', 'background:url( ' . $uri . ' );background-repeat:' . $style . ';background-position:' . $left . 'px ' . $top . 'px;min-height:' . $height . 'px;' ); } elseif ( 'external' == $embed || 'embed' == $embed ) { return apply_filters( 'raindrops_upload_image_parser_prop', $purpose . '{background:url( ' . $uri . ' );background-repeat:' . $style . ';background-position:' . $left . 'px ' . $top . 'px;min-height:' . $height . 'px;}' ); } else { return; } } return false; } } /** * Alias function Show real gradient where admin panel help * * * * * return string inline style rule what gradient */ if ( !function_exists( 'raindrops_gradient_single' ) ) { function raindrops_gradient_single( $i, $order = "asc" ) { return apply_filters( "raindrops_gradient_single", raindrops_gradient_single_clone( $i, $order ) ); } } /** * Alias function Create gradient style rule * * * * return string embed header current style rule set what gradient */ if ( !function_exists( 'raindrops_gradient' ) ) { function raindrops_gradient( $selector ) { return apply_filters( "raindrops_gradient", raindrops_gradient_clone( $selector ) ); } } /** * Set stylesheet and few javascript * * * * */ if ( !function_exists( "raindrops_add_stylesheet" ) ) { function raindrops_add_stylesheet() { global $raindrops_current_theme_name, $raindrops_current_data_version, $raindrops_css_auto_include; $themes = wp_get_themes(); $current_theme = $raindrops_current_theme_name; $template_uri = get_template_directory_uri(); //$template_uri = str_replace( 'http:','', $template_uri ); $template_path = get_template_directory(); $stylesheet_uri = get_stylesheet_directory_uri(); //$stylesheet_uri = str_replace( 'http:','', $stylesheet_uri ); $stylesheet_path = get_stylesheet_directory(); $reset_font_grid = $stylesheet_uri . '/reset-fonts-grids.css'; if ( !file_exists( $stylesheet_path . '/reset-fonts-grids.css' ) ) { $reset_font_grid = $template_uri . '/reset-fonts-grids.css'; } wp_register_style( 'raindrops_reset_fonts_grids', $reset_font_grid, array(), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'raindrops_reset_fonts_grids' ); $grids = $stylesheet_uri . '/grids.css'; if ( !file_exists( $stylesheet_path . '/grids.css' ) ) { $grids = $template_uri . '/grids.css'; } wp_register_style( 'raindrops_grids', $grids, array( 'raindrops_reset_fonts_grids' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'raindrops_grids' ); $fonts = $stylesheet_uri . '/fonts.css'; if ( !file_exists( $stylesheet_path . '/fonts.css' ) ) { $fonts = $template_uri . '/fonts.css'; } wp_register_style( 'raindrops_fonts', $fonts, array( 'raindrops_grids' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'raindrops_fonts' ); $language = get_locale(); $lang = ''; if ( !file_exists( $stylesheet_path . '/languages/css/' . $language . '.css' ) ) { if ( file_exists( $template_path . '/languages/css/' . $language . '.css' ) ) { $lang = $template_uri . '/languages/css/' . $language . '.css'; } } else { $lang = $stylesheet_uri . '/languages/css/' . $language . '.css'; } if ( !empty( $lang ) ) { wp_register_style( 'lang_style', $lang, array( 'raindrops_fonts' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'lang_style' ); } if ( raindrops_warehouse_clone( "raindrops_style_type" ) !== 'w3standard' ) { if ( file_exists( get_stylesheet_directory() . '/css3.css' ) ) { $raindrops_css3 = $stylesheet_uri . '/css3.css'; } else { $raindrops_css3 = $template_uri . '/css3.css'; } wp_register_style( 'raindrops_css3', $raindrops_css3, array( 'raindrops_fonts' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'raindrops_css3' ); } if ( $raindrops_css_auto_include == true ) { $child = $template_uri . '/style.css'; wp_register_style( 'style', $child, array( 'raindrops_fonts' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'style' ); } if ( is_child_theme() ) { $child = $stylesheet_uri . '/style.css'; wp_register_style( 'child', $child, array( 'style' ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'child' ); } if ( is_child_theme() ) { $depending_on_style = 'child'; } else { $depending_on_style = 'style'; } if ( raindrops_warehouse_clone( "raindrops_page_width" ) == 'doc3' ) { if ( file_exists( get_stylesheet_directory() . '/responsiveness.css' ) ) { $raindrops_responsiveness = $stylesheet_uri . '/responsiveness.css'; } else { $raindrops_responsiveness = $template_uri . '/responsiveness.css'; } wp_register_style( 'raindrops_responsiveness', $raindrops_responsiveness, array( $depending_on_style ), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'raindrops_responsiveness' ); } /* add small js */ $raindrops_js = $stylesheet_uri . '/raindrops.js'; if ( !file_exists( $stylesheet_path . '/raindrops.js' ) ) { $raindrops_js = $template_uri . '/raindrops.js'; } wp_register_script( 'raindrops', $raindrops_js, array( 'jquery', 'jquery-migrate' ), $raindrops_current_data_version, false ); wp_enqueue_script( 'raindrops' ); } } /** * filter function comment form * * * * */ if ( !function_exists( "raindrops_comment_form" ) ) { function raindrops_comment_form( $form ) { global $commenter; $form[ 'url' ] = '

    ' . esc_html__( '( optional )', 'Raindrops' ) . '

    '; return apply_filters( "raindrops_comment_form", $form ); } } /** * filter function remove area required * * * * */ if ( !function_exists( "raindrops_custom_remove_aria_required" ) ) { function raindrops_custom_remove_aria_required( $arg ) { global $raindrops_document_type; if ( $raindrops_document_type == 'xhtml' ) { $change = array( "aria-required=\"true\"", "aria-required='true'" ); $arg = str_replace( $change, '', $arg ); return $arg; } else { return $arg; } } } /** * Option value set when install. * * * * */ if ( !function_exists( "setup_raindrops" ) ) { function setup_raindrops() { global $wpdb, $raindrops_base_setting; if ( false == RAINDROPS_USE_AUTO_COLOR ) { return; } $raindrops_theme_settings = get_option( 'raindrops_theme_settings' ); foreach ( $raindrops_base_setting as $add ) { $option_name = $add[ 'option_name' ]; if ( !isset( $raindrops_theme_settings[ $option_name ] ) ) { $raindrops_theme_settings[ $option_name ] = $add[ 'option_value' ]; } } $style_type = raindrops_warehouse_clone( "raindrops_style_type" ); $raindrops_indv_css = raindrops_design_output_clone( $style_type ) . raindrops_color_base_clone(); $raindrops_theme_settings[ '_raindrops_indv_css' ] = $raindrops_indv_css; update_option( 'raindrops_theme_settings', $raindrops_theme_settings, "", $add[ 'autoload' ] ); if ( file_exists( get_stylesheet_directory() . '/images/headers/wp3.jpg' ) ) { $raindrops_site_image = get_stylesheet_directory_uri() . '/images/headers/wp3.jpg'; $raindrops_site_thumbnail_image = get_stylesheet_directory_uri() . '/images/headers/wp3-thumbnail.jpg'; } else { $raindrops_site_image = get_template_directory_uri() . '/images/headers/wp3.jpg'; $raindrops_site_thumbnail_image = get_template_directory_uri() . '/images/headers/wp3-thumbnail.jpg'; } set_theme_mod( 'default-image', $raindrops_site_image ); } } /** * image element has attribute 'width','height' and image size > column width * style max-width value 100% set when expand height height attribute value. * * IE filter * */ if ( !function_exists( "raindrops_ie_height_expand_issue" ) ) { function raindrops_ie_height_expand_issue( $content ) { global $is_IE, $content_width; if ( $is_IE ) { preg_match_all( '#(]+)(height|width)(=")([0-9]+)"([^>]+)(height|width)(=")([0-9]+)"([^>]*)>#', $content, $images, PREG_SET_ORDER ); foreach ( $images as $image ) { if ( ( "width" == $image[ 3 ] && $image[ 5 ] > $content_width ) || ( "width" == $image[ 7 ] && $image[ 9 ] > $content_width ) ) { $content = str_replace( $image[ 0 ], $image[ 1 ] . $image[ 2 ] . $image[ 6 ] . $image[ 10 ] . '>', $content ); } } return $content; } else { return $content; } } } /** * Raindrops once message when install. * * * * * */ if ( !function_exists( "raindrops_first_only_msg" ) ) { function raindrops_first_only_msg( $type = 0 ) { global $raindrops_current_theme_name; if ( 1 == $type ) { $query = 'raindrops_settings'; $link = get_site_url( '', 'wp-admin/themes.php', 'admin' ) . '?page=' . $query; if ( version_compare( PHP_VERSION, '5.0.0', '<' ) ) { $msg = sprintf( esc_html__( 'Sorry Your PHP version is %s Please use PHP version 5 || later.', 'Raindrops' ), PHP_VERSION ); } else { $msg = sprintf( esc_html__( 'Thank you for adopting the %1$s theme. It is necessary to set it to this theme. Please move to a set screen clicking this ', 'Raindrops' ) . '' . esc_html__( 'Raindrops settings view', 'Raindrops' ) . '.', $raindrops_current_theme_name, $link ); } } return '

    ' . $msg . '

    ' . "\n"; } } /** * Management of uninstall and install. * * * * ver 1.114 Theme data automatic change is supported at the time of site change. */ if ( !function_exists( "raindrops_install_navigation" ) ) { function raindrops_install_navigation() { $install = get_option( 'raindrops_theme_settings' ); $upload_dir = wp_upload_dir(); if ( false == $install ) { } else { if ( isset( $install[ 'current_stylesheet_dir_url' ] ) && get_stylesheet_directory_uri() !== $install[ 'current_stylesheet_dir_url' ] ) { $install[ '_raindrops_indv_css' ] = str_replace( $install[ 'current_stylesheet_dir_url' ], get_stylesheet_directory_uri(), $install[ '_raindrops_indv_css' ] ); $install[ 'old_stylesheet_dir_url' ] = $install[ 'current_stylesheet_dir_url' ]; $install[ 'current_stylesheet_dir_url' ] = get_stylesheet_directory_uri(); update_option( 'raindrops_theme_settings', $install ); } elseif ( !isset( $install[ 'current_stylesheet_dir_url' ] ) ) { $install[ 'current_stylesheet_dir_url' ] = get_stylesheet_directory_uri(); update_option( 'raindrops_theme_settings', $install ); } if ( isset( $install[ 'current_upload_base_url' ] ) && $upload_dir !== $install[ 'current_upload_base_url' ] ) { $install[ '_raindrops_indv_css' ] = str_replace( $install[ 'current_upload_base_url' ], $upload_dir[ 'baseurl' ], $install[ '_raindrops_indv_css' ] ); $install[ 'old_upload_base_url' ] = $install[ 'current_upload_base_url' ]; $install[ 'current_upload_base_url' ] = $upload_dir[ 'baseurl' ]; update_option( 'raindrops_theme_settings', $install ); } elseif ( !isset( $install[ 'current_upload_base_url' ] ) ) { $install[ 'current_upload_base_url' ] = $upload_dir[ 'baseurl' ]; update_option( 'raindrops_theme_settings', $install ); } if( 'delete' == raindrops_warehouse_clone( "raindrops_uninstall_option" ) ) { add_action( 'switch_theme', 'raindrops_delete_all_options' ); } } } } if ( !function_exists( "raindrops_delete_all_options" ) ) { function raindrops_delete_all_options(){ if( current_user_can( 'delete_themes' ) ) { delete_option( 'raindrops_theme_settings' ); remove_theme_mods(); delete_option( 'widget_raindrops_pinup_entry_widget' ); delete_option( 'widget_raindrops_entrywidget' ); $allposts = get_posts( 'numberposts=0&post_type=post&post_status=') ; foreach( $allposts as $postinfo ) { delete_post_meta($postinfo->ID, '_web_fonts_styles'); delete_post_meta($postinfo->ID, '_web_fonts_link_element'); delete_post_meta($postinfo->ID, '_css'); delete_post_meta($postinfo->ID, 'css'); delete_post_meta($postinfo->ID, '_add-to-front'); delete_post_meta($postinfo->ID, '_raindrops_this_header_image'); delete_post_meta($postinfo->ID, 'meta'); if ( RAINDROPS_CUSTOM_FIELD_SCRIPT == true ) { delete_post_meta($postinfo->ID, 'javascript'); } } $allposts = get_posts( 'numberposts=0&post_type=page&post_status=') ; foreach( $allposts as $postinfo ) { delete_post_meta($postinfo->ID, '_web_fonts_styles'); delete_post_meta($postinfo->ID, '_web_fonts_link_element'); delete_post_meta($postinfo->ID, '_css'); delete_post_meta($postinfo->ID, 'css'); delete_post_meta($postinfo->ID, '_add-to-front'); delete_post_meta($postinfo->ID, '_raindrops_this_header_image'); delete_post_meta($postinfo->ID, 'meta'); if ( RAINDROPS_CUSTOM_FIELD_SCRIPT == true ) { delete_post_meta($postinfo->ID, 'javascript'); } } } } } /** * insert into embed style ,javascript script and embed tags from custom field * * * * */ if ( !function_exists( "raindrops_embed_css" ) ) { function raindrops_embed_css() { global $post, $raindrops_fluid_or_fixed, $raindrops_fluid_minimum_width, $raindrops_wp_version, $raindrops_current_theme_name, $raindrops_page_width, $raindrops_base_font_size; $css = ''; //#header-image $css .= "\n" . raindrops_header_image( 'css' ) . "\n"; //site-title $raindrops_text_color = get_theme_mod( 'header_textcolor', 'dddddd' ); if ( $raindrops_text_color !== 'blank' && display_header_text() == true ) { $css .= "\n#site-title a{color:#" . $raindrops_text_color . ';}'; } //page type if ( isset( $raindrops_fluid_or_fixed ) && !empty( $raindrops_fluid_or_fixed ) && ( 'doc' == raindrops_warehouse_clone( "raindrops_page_width" ) || 'doc2' == raindrops_warehouse_clone( "raindrops_page_width" ) || 'custom-doc' == raindrops_warehouse_clone( "raindrops_page_width" ) || 'doc4' == raindrops_warehouse_clone( "raindrops_page_width" ) ) ) { $css .= raindrops_is_fixed(); } elseif ( isset( $raindrops_fluid_minimum_width ) && !empty( $raindrops_fluid_minimum_width ) ) { $css .= raindrops_is_fluid(); } //#hd $uploads = wp_upload_dir(); $header_image_uri = $uploads[ 'url' ] . '/' . raindrops_warehouse( 'raindrops_header_image' ); if ( 'raindrops' !== $raindrops_current_theme_name && 'header.png' == raindrops_warehouse( 'raindrops_header_image' ) ) { $header_image_uri = str_replace( $raindrops_current_theme_name, 'raindrops', $header_image_uri ); } $css .= "\n#hd{" . raindrops_upload_image_parser( $header_image_uri, 'inline', '#hd' ) . '}'; //#ft $footer_image_uri = $uploads[ 'url' ] . '/' . raindrops_warehouse( 'raindrops_footer_image' ); if ( 'raindrops' !== $raindrops_current_theme_name && 'footer.png' == raindrops_warehouse( 'raindrops_footer_image' ) ) { $footer_image_uri = str_replace( $raindrops_current_theme_name, 'raindrops', $footer_image_uri ); } $css .= "\n#ft{" . raindrops_upload_image_parser( $footer_image_uri, 'inline', '#ft' ) . '}'; $css .= "\n#ft{color:". raindrops_warehouse( 'raindrops_footer_color' ). ';}'; // 2col 3col change style helper $css .= '/*' . raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) . '*/'; if ( "show" == raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) ) { $css .= ' .rsidebar{display:block;} '; } else { $css .= ' .rsidebar{display:none;} '; } //when manual style rule mode if ( raindrops_warehouse_clone( "raindrops_style_type" ) == $raindrops_current_theme_name ) { return $css . raindrops_warehouse_clone( '_raindrops_indv_css' ); } $raindrops_options = get_option( "raindrops_theme_settings" ); if ( isset( $raindrops_options[ 'raindrops_style_type' ] ) && !empty( $raindrops_options[ 'raindrops_style_type' ] ) ) { $raindrops_style_type = $raindrops_options[ 'raindrops_style_type' ]; } else { $raindrops_style_type = ''; } $raindrops_options = get_option( 'raindrops_theme_settings' ); $raindrops_base_color = raindrops_warehouse_clone( 'raindrops_base_color' ); $raindrops_hyperlink_color = raindrops_warehouse_clone( 'raindrops_hyperlink_color' ); $raindrops_indv_css = raindrops_design_output( $raindrops_style_type ) . raindrops_color_base( $raindrops_base_color ); //when this code exists [raindrops color_type="minimal" col="1"] in the post $raindrops_indv_css = raindrops_color_type_custom( $raindrops_indv_css ); $css .= apply_filters( "raindrops_indv_css", $raindrops_indv_css ); if ( $raindrops_hyperlink_color !== '' ) { $css .= raindrops_custom_link_color( $raindrops_hyperlink_color ); } $background = get_background_image(); $color = get_background_color(); if ( !empty( $background ) || !empty( $color ) ) { $css = preg_replace( "|body[^{]*{[^}]+}|", "", $css ); } if ( raindrops_warehouse_clone( 'raindrops_basefont_settings' ) > 13 ) { $css .= 'body{font-size:' . raindrops_warehouse_clone( 'raindrops_basefont_settings' ) . 'px;}'; } elseif ( isset( $raindrops_base_font_size ) ) { $css .= 'body{font-size:' . $raindrops_base_font_size . 'px;}'; } //body background $body_background = get_theme_mod( "background_color" ); $body_background_image = get_theme_mod( "background_image" ); $body_background_repeat = get_theme_mod( "background_repeat" ); $body_background_position_x = get_theme_mod( "background_position_x" ); $body_background_attachment = get_theme_mod( "background_attachment" ); if ( $body_background !== false && !empty( $body_background ) && !empty( $body_background_image ) ) { $css .= "\nbody{background:#" . $body_background . ' url( ' . $body_background_image . ' );}'; } elseif ( $body_background !== false && !empty( $body_background ) ) { $css .= "\nbody{background-color:#" . $body_background . ';}'; } elseif ( !empty( $body_background_image ) ) { $css .= "\nbody{background-image: url( " . $body_background_image . ' );}'; } if ( isset( $body_background_repeat ) && !empty( $body_background_repeat ) ) { $css .= "\nbody{background-repeat: " . $body_background_repeat . ';}'; } if ( isset( $body_background_position_x ) && !empty( $body_background_position_x ) ) { $css .= "\nbody{background-position:top " . $body_background_position_x . ';}'; } if ( isset( $body_background_attachment ) && !empty( $body_background_attachment ) ) { $css .= "\nbody{background-attachment: " . $body_background_attachment . ';}'; } /* Primary Menu Font Size */ $primary_menu_font_size = raindrops_warehouse_clone( 'raindrops_menu_primary_font_size' ); if ( isset( $primary_menu_font_size ) && !empty( $primary_menu_font_size ) ) { $css .= '#access a{font-size:' . $primary_menu_font_size. '%;}'; } else { $css .= '#access a{font-size:100%;}'; } if ( empty( $css ) ) { $css = "cannot get style value check me"; } if ( WP_DEBUG !== true ) { $css = str_replace( array( "\n", "\r", "\t", '"', '--', '\"' ), array( "", "", "", '"', '', '"' ), $css ); } else { $css = str_replace( array( '"', '--', '\"' ), array( '"', '', '"' ), $css ); } return apply_filters( "raindrops_embed_meta_css", $css ); } } /** * * * * * */ if ( !function_exists( "raindrops_custom_link_color" ) ) { function raindrops_custom_link_color( $color ) { $css = <<< LINK_COLOR_CSS .entry-content a:link, .entry-content a:active, .entry-content a:visited, .entry-content a:hover{ color:{$color}; } .entry-title a:link, .entry-title a:active, .entry-title a:visited, .entry-title a:hover{ color:{$color}; } .posted-on a:link, .posted-on a:active, .posted-on a:visited, .posted-on a:hover{ color:{$color}; } .entry-meta-default .entry-date{ color:{$color}; }/*single.php*/ .entry-meta-default .author a{ color:{$color}; }/*single.php*/ .post .entry-meta, .entry-meta a:link, .entry-meta a:active, .entry-meta a:visited, .entry-meta a:hover{ color:{$color}; } .rsidebar a:link, .rsidebar a:active, .rsidebar a:visited, .rsidebar a:hover{ color:{$color}; } .lsidebar a:link, .lsidebar a:active, .lsidebar a:visited, .lsidebar a:hover{ color:{$color}; } #wp-calendar{ color:{$color}; } .raindrops-comment-link em, .raindrops-comment-link a:link em, .raindrops-comment-link a:active em, .raindrops-comment-link a:visited em, .raindrops-comment-link a:hover em{ color:{$color}! important; } #nav-above .nav-previous a, #nav-above .nav-next a, #nav-below .nav-previous a, #nav-below .nav-next a{ color:{$color}; } .logged-in-as a:link, .logged-in-as a:active, .logged-in-as a:visited, .logged-in-as a:hover{ color:{$color}; } LINK_COLOR_CSS; if ( preg_match( "!#([0-9a-f]{6}|[0-9a-f]{3})!si", $color ) ) { return apply_filters( "raindrops_custom_link_color", $css ); } } } /** * * * * * */ if ( !function_exists( "raindrops_embed_meta" ) ) { function raindrops_embed_meta( $content ) { global $post, $wp_customize; $result = ""; $css = ''; if ( isset( $wp_customize ) ) { $css .= raindrops_embed_css(); } $result_indv = ''; $pinup_style = ''; if ( RAINDROPS_USE_AUTO_COLOR !== true ) { // $css = ''; } if ( is_single() || is_page() ) { $pinup_widget_ids = raindrops_get_pinup_widget_ids(); $pinup_widget_post_ids = raindrops_pinup_widget_ids_to_post_ids( $pinup_widget_ids ); foreach( $pinup_widget_post_ids as $pinup_id ){ $web_fonts = get_post_meta( $pinup_id, '_web_fonts_link_element', true ); if ( isset( $web_fonts ) && !empty( $web_fonts ) ) { $web_fonts_each_array = explode("\n", $web_fonts); foreach( $web_fonts_each_array as $web_fonts_each ) { $result = str_replace( array( $web_fonts_each,"\n\n"), array('',"\n"), $result ); $result .= $web_fonts_each ."\n"; } } $web_fonts_style = get_post_meta( $pinup_id, '_web_fonts_styles', true ); if ( isset( $web_fonts_style ) && !empty( $web_fonts_style ) ) { $web_fonts_style_each_array = explode("\n", $web_fonts_style ); foreach( $web_fonts_style_each_array as $web_fonts_style_each ) { $pinup_style = str_replace( array( $web_fonts_style_each,"\n\n"), array('',"\n"), $pinup_style ); $pinup_style .= $web_fonts_style_each ."\n"; } } } $web_fonts = get_post_meta( get_the_ID(), '_web_fonts_link_element', true ); if ( isset( $web_fonts ) && !empty( $web_fonts ) ) { $result .= $web_fonts ; } $web_fonts_styles = get_post_meta( $post->ID, '_web_fonts_styles', true ); if ( ( isset( $web_fonts_styles ) && !empty( $web_fonts_styles ) ) || !empty( $pinup_style )) { $web_fonts_styles_wrapper = "'. "\n"; $result .= sprintf( $web_fonts_styles_wrapper, $web_fonts_styles. $pinup_style ); } $css_single = get_post_meta( $post->ID, 'css', true ); /* 1.234 metabox support */ $css_single .= get_post_meta( $post->ID, '_css', true ); if ( true == RAINDROPS_OVERRIDE_POST_STYLE_ALL_CONTENTS ) { $css .= preg_replace_callback( '![^}]+{[^}]+}!siu', 'raindrops_css_add_id', $css_single ); } else { $css .= $css_single; } if ( !empty( $css ) && RAINDROPS_CUSTOM_FIELD_CSS == true ) { $result .= '"; } $meta = get_post_meta( $post->ID, 'meta', true ); if ( !empty( $meta ) && RAINDROPS_CUSTOM_FIELD_META == true ) { $result .= raindrops_esc_custom_field_meta( $meta ); } $javascript = get_post_meta( $post->ID, 'javascript', true ); if ( !empty( $javascript ) && RAINDROPS_CUSTOM_FIELD_SCRIPT == true ) { $result .= '"; } } else { $pinup_widget_ids = raindrops_get_pinup_widget_ids(); $pinup_widget_post_ids = raindrops_pinup_widget_ids_to_post_ids( $pinup_widget_ids ); if( isset($pinup_widget_post_ids) && is_array( $pinup_widget_post_ids ) ) { foreach( $pinup_widget_post_ids as $pinup_id ){ $web_fonts = get_post_meta( $pinup_id, '_web_fonts_link_element', true ); if ( isset( $web_fonts ) && !empty( $web_fonts ) ) { $web_fonts_each_array = explode("\n", $web_fonts); foreach( $web_fonts_each_array as $web_fonts_each ) { $result = str_replace( array( $web_fonts_each,"\n\n"), array('',"\n"), $result ); $result .= $web_fonts_each ."\n"; } } $web_fonts_style = get_post_meta( $pinup_id, '_web_fonts_styles', true ); if ( isset( $web_fonts_style ) && !empty( $web_fonts_style ) ) { $web_fonts_style_each_array = explode("\n", $web_fonts_style ); foreach( $web_fonts_style_each_array as $web_fonts_style_each ) { $result_indv = str_replace( array( $web_fonts_style_each,"\n\n"), array('',"\n"), $result_indv ); $result_indv .= $web_fonts_style_each ."\n"; } } } } if ( true == RAINDROPS_OVERRIDE_POST_STYLE_ALL_CONTENTS ) { if ( have_posts() && !is_date() ) { if ( false == RAINDROPS_USE_AUTO_COLOR ) { } while ( have_posts() ) { the_post(); $web_fonts = get_post_meta( $post->ID, '_web_fonts_link_element', true ); if ( isset( $web_fonts ) && !empty( $web_fonts ) ) { $web_fonts_each_array = explode("\n", $web_fonts); foreach( $web_fonts_each_array as $web_fonts_each ) { $result = str_replace( array( $web_fonts_each,"\n\n"), array('',"\n"), $result ); $result .= $web_fonts_each ."\n"; } } $web_fonts_style = get_post_meta( $post->ID, '_web_fonts_styles', true ); if ( isset( $web_fonts_style ) && !empty( $web_fonts_style ) ) { $web_fonts_style_each_array = explode("\n", $web_fonts_style ); foreach( $web_fonts_style_each_array as $web_fonts_style_each ) { $result_indv = str_replace( array( $web_fonts_style_each,"\n\n"), array('',"\n"), $result_indv ); $result_indv .= $web_fonts_style_each ."\n"; } } $collections = get_post_meta( $post->ID, 'css', true ); $collections .= get_post_meta( $post->ID, '_css', true ); if ( !empty( $collections ) ) { $result_indv .= preg_replace_callback( '![^}]+{[^}]+}!siu', 'raindrops_css_add_id', $collections ); } } rewind_posts(); } } $result .= '\n"; } echo apply_filters( 'raindrops_embed_meta_echo', $result ); return $content; } } if ( !function_exists( 'raindrops_esc_custom_field_meta' ) ) { function raindrops_esc_custom_field_meta( $meta_input ) { if ( RAINDROPS_CUSTOM_FIELD_META !== true ) { return; } $meta = preg_replace( '!>[^<]+\n<", $meta_input ); $meta = "\n{$meta}\n"; $meta = preg_replace( '!style\s*=\s*("|\')[^"\']+("|\')!', '', $meta ); $meta = preg_replace( '!onmouseover\s*=\s*("|\')[^"\']+("|\')!', '', $meta ); $meta = strip_tags( $meta, '' ); if ( is_singular() && !empty( $meta_input ) ) { return apply_filters( 'raindrops_esc_custom_field_meta', $meta, $meta_input ); } return; } } /** * When custom field element add single post display properly. * But loop page not adding element,result display improperly. * this filter detect custom field and add base URL to relative links and image source. */ add_filter( 'the_content', 'raindrops_custom_field_meta_helper' ); if ( !function_exists( 'raindrops_custom_field_meta_helper' ) ) { function raindrops_custom_field_meta_helper( $content ) { global $post; $meta_values = ''; if ( isset( $post ) ) { $meta_values = get_post_meta( $post->ID, 'meta', true ); } if ( !empty( $meta_values ) && strstr( $meta_values, ' $match ) { if ( preg_match( '|^(.+){(.+)|siu', $match, $regs ) ) { $match_1 = str_replace( ',', ', #post-' . $post->ID . ' ', $regs[ 1 ] ); $match = $match_1 . '{' . $regs[ 2 ]; } $result .= '#post-' . $post->ID . ' ' . trim( $match ) . "\n"; } return $result; } } /** * Alternative character when value is blank * * * * */ if ( !function_exists( "raindrops_blank_fallback" ) ) { function raindrops_blank_fallback( $string, $fallback ) { if ( !empty( $string ) ) { return $string; } else { return $fallback; } } } /** * Article navigation * * * * */ if ( !function_exists( "raindrops_prev_next_post" ) ) { function raindrops_prev_next_post( $position = "nav-above" ) { if ( is_category() ) { $filter = true; //display same category. } else { $filter = false; } //exclude separate 'and' $exclude_category = apply_filters( 'raindrops_next_prev_excluded_categories', '' ); $html = '
    '; printf( $html, $position, "clearfix", "nav-previous" ); previous_post_link( '%link', '« %title', $filter, $exclude_category ); $html = '
    '; printf( $html, "nav-next" ); next_post_link( '%link', ' %title »', $filter, $exclude_category ); $html = '
    '; echo apply_filters( "raindrops_prev_next_post", $html ); } } /** * date.php * * * * */ if ( !function_exists( "raindrops_days_in_month" ) ) { function raindrops_days_in_month( $month, $year ) { $daysInMonth = array( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); if ( $month != 2 ) { return $daysInMonth[ $month - 1 ]; } return ( checkdate( $month, 29, $year ) ) ? 29 : 28; } } /** * for date.php * * * * */ if ( !function_exists( "raindrops_get_year" ) ) { function raindrops_get_year( $posts = '', $year = '', $pad = 0 ) { global $calendar_page_number, $post_per_page, $calendar_page_last, $calendar_page_start; $months = array(); $y = ""; $m = ""; $d = ""; // first let's parse through our posts, organizing them by month foreach ( $posts as $post ) { $y = substr( $post->post_date, 0, 4 ); $m = substr( $post->post_date, 5, 2 ); $d = substr( $post->post_date, 8, 2 ); $months[ $m ][] = $post; } $output = "

    $year

    "; $table_year = array( '', '', '', '', '', '', '', '', '', '', '', '', '', '
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ' ); foreach ( $months as $num => $val ) { $num = (int) $num; $table_year[ $num ] = '" . $num . '" . sprintf( esc_html__( "%s Articles archived", "Raindrops" ), count( $val ) ) . ''; } return $output . implode( "\n", $table_year ); } } /* end raindrops_get_year( ) */ /** * for date.php * * * * */ if ( !function_exists( "raindrops_get_day" ) ) { function raindrops_get_day( $posts = '', $year = '', $mon = '', $day = '', $pad = 1 ) { global $month; $here = home_url(); $output = "

    $year " . $mon . " " . $day . "

    "; $output .= ''; foreach ( $posts as $mytime ) { $h = substr( $mytime->post_date, 11, 2 ); if ( 10 > $h ) { $h = substr( $h, 1, 1 ); } $today[ $h ][] = $mytime; } for ( $i = 0; $i <= 24; $i++ ) { $output .= ''; } $output .= '
    '; if ( 10 > $i ) { $output .= "0$i:00"; } else { $output .= "$i:00"; } $output .= ''; if ( isset( $today[ $i ] ) ) { foreach ( $today[ $i ] as $mytime ) { $mytime->post_title = raindrops_fallback_title( $mytime->post_title ); $mytime->post_title = preg_replace( '|>.+[Article ' . $mytime->ID . ']post_title ); $output .= "ID ) . "\" id=\"post-" . $mytime->ID . "\">$mytime->post_title
    "; } } else { $output .= '.'; } $output .= '
    '; return $output; } } /* end raindrops_get_day( ) */ /** * for date.php * * * * */ if ( !function_exists( "raindrops_year_list" ) ) { function raindrops_year_list( $one_month, $ye, $mo ) { global $calendar_page_number, $post_per_page, $calendar_page_last, $calendar_page_start; $d = ""; $links = ""; $result = ""; foreach ( $one_month as $key => $month ) { list( $y, $m, $d ) = sscanf( $month->post_date, "%d-%d-%d $d:$d:$d" ); $month->post_title = raindrops_fallback_title( $month->post_title ); $month->post_title = preg_replace( '|>.+[link to ' . $month->ID . ']post_title ); if ( $m == $mo && $ye == $y ) { $links .= "
  • ID ) . "\" title=\"" . esc_attr( strip_tags( $month->post_title ) ) . "\">" . $month->post_title . "
  • "; } } if ( !empty( $links ) ) { $result .= "
      "; $result .= $links; $result .= "
    "; } return $result; } } /** * sort month_list * * * * */ if ( !function_exists( "raindrops_cmp_ids" ) ) { function raindrops_cmp_ids( $a, $b ) { $cmp = strcmp( $a->post_date, $b->post_date ); return $cmp; } } /** * for date.php * * * * * */ if ( !function_exists( "raindrops_month_list" ) ) { function raindrops_month_list( $one_month, $ye, $mo ) { global $calendar_page_number, $post_per_page, $calendar_page_last, $calendar_page_start; $result = ""; $here = home_url(); $z = - 1; $c = 0; for ( $i = 1; $i <= raindrops_days_in_month( $mo, $ye ); $i++ ) { $links = ""; usort( $one_month, "raindrops_cmp_ids" ); $page_break = false; $first_data = false; foreach ( $one_month as $key => $month ) { list( $y, $m, $d, $h, $m, $s ) = sscanf( $month->post_date, "%d-%d-%d %d:%d:%d" ); if ( $key < $calendar_page_last && $key >= $calendar_page_start ) { if ( $d == $i && $m == $mo && $y == $ye ) { $first_data = true; $month->post_title = raindrops_fallback_title( $month->post_title ); $month->post_title = preg_replace( '|>.+[link to ' . $month->ID . ']post_title ); $html = '
  • %4$s <%7$s class="entry-date updated" %8$s>%9$s %12$s
  • '; $display_name = get_the_author_meta( 'display_name', $month->post_author ); $links .= sprintf( $html, 'h2 entry-title', esc_url( get_permalink( $month->ID ) ), 'link to content: ' . esc_attr( strip_tags( $month->post_title ) ), $month->post_title, $month->ID, ' ' . raindrops_post_class( array( 'clearfix' ), $month->ID, false ), raindrops_doctype_elements( 'span', 'time', false ), raindrops_doctype_elements( '', 'datetime="' . esc_attr( get_the_date( 'c' ) ) . '"', false ), $month->post_date, get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'Raindrops' ), $display_name ), $display_name ); $c++; } } } $post_per_page = get_option( 'posts_per_page' ); $post_per_page = apply_filters( 'raindrops_month_list_post_count', $post_per_page ); if ( $z == $c && $c == $post_per_page ) { break; } if ( !empty( $links ) ) { $result .= ""; $result .= ""; $result .= $i; $result .= "
      "; $result .= $links; $result .= "
    "; } else { $result .= ""; $result .= $i; $result .= "  "; } $z = $c; } $output = "

    " . esc_html( $y ) . " " . esc_html( $m ) . "

    "; return $output . '' . $result . "
    "; } } /** * index ,archive,loops page title * * echo Archives title * * */ if ( !function_exists( "raindrops_loop_title" ) ) { function raindrops_loop_title() { global $template; $Raindrops_class_name = ""; $page_title = ""; $page_title_c = ""; if ( is_search() ) { $Raindrops_class_name = 'serch-result'; $page_title = esc_html__( "Search Results", 'Raindrops' ); $page_title_c = get_search_query(); } elseif ( is_tag() ) { $Raindrops_class_name = 'tag-archives'; $page_title = esc_html__( "Tag Archives", 'Raindrops' ); $page_title_c = single_term_title( "", false ); } elseif ( is_category() ) { $Raindrops_class_name = 'category-archives'; $page_title = esc_html__( "Category Archives", 'Raindrops' ); $page_title_c = single_cat_title( '', false ); } elseif ( is_archive() ) { $raindrops_date_format = get_option( 'date_format' ); if ( is_day() ) { $Raindrops_class_name = 'dayly-archives'; $page_title = esc_html__( 'Daily Archives', 'Raindrops' ); $page_title_c = get_the_date( $raindrops_date_format ); } elseif ( is_month() ) { $Raindrops_class_name = 'monthly-archives'; $page_title = esc_html__( 'Monthly Archives', 'Raindrops' ); if ( 'ja' == get_locale() ) { $page_title_c = get_the_date( 'Y / F' ); } else { $page_title_c = get_the_date( 'F Y' ); } } elseif ( is_year() ) { $Raindrops_class_name = 'yearly-archives'; $page_title = esc_html__( 'Yearly Archives', 'Raindrops' ); $page_title_c = get_the_date( 'Y' ); } elseif ( is_author() ) { $Raindrops_class_name = 'author-archives'; $page_title = esc_html__( "Author Archives", 'Raindrops' ); while ( have_posts() ) { the_post(); $page_title_c = get_avatar( get_the_author_meta( 'user_email' ), 32 ) . ' ' . get_the_author(); break; } rewind_posts(); } elseif ( has_post_format( 'aside' ) ) { $slug = 'aside'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'Raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'chat' ) ) { $slug = 'chat'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'Raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'gallery' ) ) { $slug = 'gallery'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'Raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'link' ) ) { $slug = 'link'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'Raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'image' ) ) { $slug = 'image'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'Raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'quote' ) ) { $slug = 'quote'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'Raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'status' ) ) { $slug = 'status'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'Raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'video' ) ) { $slug = 'video'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'Raindrops' ); $page_title_c = get_post_format_string( $slug ); } elseif ( has_post_format( 'audio' ) ) { $slug = 'audio'; $Raindrops_class_name = 'post-format-' . $slug; $page_title = esc_html__( 'Post Format', 'Raindrops' ); $page_title_c = get_post_format_string( $slug ); } else { $Raindrops_class_name = 'blog-archives'; $page_title = esc_html__( "Blog Archives", 'Raindrops' ); } } if ( empty( $Raindrops_class_name ) ) { if ( is_front_page() ) { $Raindrops_class_name = 'front-page '; } $Raindrops_class_name .= basename( $template, '.php' ); $Raindrops_class_name = str_replace( array( '_', ), array( '-', ), $Raindrops_class_name ); } if ( !empty( $Raindrops_class_name ) ) { echo "\n". str_repeat("\t", 7 ). '
      '; } else { echo "\n". str_repeat("\t", 7 ). '
        '; } if ( !empty( $page_title ) ) { printf( '
      • %s %s
      • ', apply_filters( 'raindrops_archive_name', $page_title ), apply_filters( 'raindrops_archive_value', $page_title_c ) ); } } } /** * yui helper function * * * * * */ if ( !function_exists( "raindrops_yui_class_modify" ) ) { function raindrops_yui_class_modify( $raindrops_inner_class = 'yui-ge' ) { // global $yui_inner_layout; $value = raindrops_warehouse_clone( 'raindrops_right_sidebar_width_percent' ); if ( '25' == $value ) { $yui_inner_layout = 'yui-ge'; } elseif ( '75' == $value ) { $yui_inner_layout = 'yui-gf'; } elseif ( '33' == $value ) { $yui_inner_layout = 'yui-gc'; } elseif ( '66' == $value ) { $yui_inner_layout = 'yui-gd'; } elseif ( '50' == $value ) { $yui_inner_layout = 'yui-g'; } else { $yui_inner_layout = 'yui-ge'; } return apply_filters( 'raindrops_yui_class_modify', $yui_inner_layout ); } } /** * Template conditional function Raindrops display 2column or not * * * @param string css rule or text * @param bool if value is true echo or false return * @return string input strings text */ if ( !function_exists( "is_2col_raindrops" ) ) { function is_2col_raindrops( $action = true, $echo = true ) { if ( 'hide' == Raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) ) { if ( true == $echo ) { echo $action; } else { return $action; } } else { return false; } } } /** * yui layout curc * * * * @return content width */ if ( !function_exists( "raindrops_main_width" ) ) { function raindrops_main_width() { return raindrops_content_width_clone(); } } /** * content width curc * * * * * @return main column width */ if ( !function_exists( "raindrops_content_width" ) ) { function raindrops_content_width() { return raindrops_content_width_clone(); } } /** * fallback stylesheet * * * * */ if ( !function_exists( "raindrops_w3standard" ) ) { function raindrops_w3standard() { $font_color = raindrops_colors( $num = 5, $select = 'color', $color1 = null ); $style = << a, #access ul ul :active > a { top:0; %c2% color:%custom_color% } #access ul li.current_page_item > a, #access ul li.current-menu-ancestor > a, #access ul li.current-menu-item > a, #access ul li.current-menu-parent > a { %c3% } .ie6 #access ul li.current_page_item a, .ie6 #access ul li.current-menu-ancestor a, .ie6 #access ul li.current-menu-item a, .ie6 #access ul li.current-menu-parent a, .ie6 #access ul li a:hover { %c2% } table, table td, #access > li{ border:1px solid #ccc; } tfoot td{ border:none; } .lsidebar li, .rsidebar li{ border:none! important; } td.month-date,td.month-name,td.time{ %c4% } .datetable td li{ } address{margin:10px auto;} .wp-caption { } li.byuser, li.bypostauthor { %c5% } .comment-meta a, cite.fn{ } .datetable td li{ } .fail-search, #not-found { %c3% border:3px double; } .rd-page-navigation li{ border-left:solid 1px %c_border%; %c5% } .rd-page-navigation a{ %c5% } .rd-page-navigation .current_page_item{ %c4% } .raindrops-tab-content, .raindrops-tab-list li{ border:1px solid %c_border%; } /*comment bubble*/ a.raindrops-comment-link { } .raindrops-comment-link em { %c4% position: relative; } .raindrops-comment-link .point { border-left: 0.45em solid %c_border%; border-bottom: 0.45em solid #FFF; /* IE fix */ border-bottom: 0.45em solid %c_border%; overflow: hidden; /* IE fix */ } a.raindrops-comment-link:hover { } a.raindrops-comment-link:hover em { %c5% } a.raindrops-comment-link:hover .point { border-left:1px solid %c_border%; } DOC; return $style; } } /** * plugin API * * * * * */ if ( !function_exists( "plugin_is_active" ) ) { function plugin_is_active( $plugin_path ) { $return_var = in_array( $plugin_path, get_option( 'active_plugins' ) ); return $return_var; } if ( plugin_is_active( 'tmn-quickpost/tmn-quickpost.php' ) ) { global $base_info; foreach ( $base_info[ 'root' ] as $key => $val ) { $wp_cockneyreplace[ '%' . $key . '%' ] = $val; } function raindrops_import_post_meta() { global $post, $base_info; $r = get_post_meta( $post->ID, 'template', true ); foreach ( $base_info[ 'root' ] as $key => $val ) { $r = str_replace( '%' . $key . '%', $val, $r ); } if ( class_exists( 'trans' ) ) { $n = new trans( $r ); return $n->text2html(); } else { return $r; } } } } /** Custom Image Header for Raindrops theme * * * * * */ if ( !function_exists( 'raindrops_header_style' ) ) { function raindrops_header_style() { ?> $v ) { if ( preg_match( '!^.+(,|{)!si', $v, $regs ) ) { $css_result .= '#headimg ' . $regs[ 0 ] . "\n"; } else { $css_result .= $v . "\n"; } } $css_result = str_replace( array( '#headimg body', 'a:hover' ), array( '#headimg', 'a' ), $css_result ); ?>
        '; printf( $html, 'headimg', 'top' ); $uploads = wp_upload_dir(); $header_image_uri = $uploads[ 'url' ] . '/' . raindrops_warehouse_clone( 'raindrops_header_image' ); $html = '
        '; $exception_page_width = raindrops_warehouse_clone( 'raindrops_page_width' ); if ( 'doc3' == $exception_page_width ) { /* doc3 fluid layout , image displayed shrink , expand */ $add_fluid_style = ""; $add_fluid_style_description_html = '

        ' . esc_html__( 'Current theme is fluid settings', 'Raindrops' ) . '

        ' . esc_html__( 'image size will be shrink to fit page', 'Raindrops' ) . '

        '; $add_fluid_style_description_html .= '
      • ' . esc_html__( 'Theme Settings', 'Raindrops' ) . '
      • '; $add_fluid_style_description_html .= '
        '; } else { $add_fluid_style = ""; $add_fluid_style_description_html = ''; } printf( $html, 'hd', raindrops_upload_image_parser( $header_image_uri, 'inline', '#hd' ) . $add_fluid_style ); /** Site description display position * * * Site description diaplay at image when if header text Display Text value is yes. * Site description diaplay at header bar when if header text Display Text value is no. * * */ if ( 'blank' == get_theme_mod( 'header_textcolor' ) || '' == get_theme_mod( 'header_textcolor' ) ) { $raindrops_show_hide = ''; $style = ' style="display:none;"'; } elseif ( preg_match( "!([0-9a-f]{6}|[0-9a-f]{3})!si", get_header_textcolor() ) ) { $style = ' style="color:#' . get_header_textcolor() . ';"'; $raindrops_show_hide = ' style="display:none;"'; } else { $style = ''; $raindrops_show_hide = ' style="display:none;"'; } /** * Conditional Switch html headding element * * * * * */ if ( is_home() || is_front_page() ) { $heading_elememt = 'h1'; } else { $heading_elememt = 'div'; } $title_format = '<%s class="h1" id="site-title">%s'; printf( $title_format, $heading_elememt, home_url(), esc_attr( get_bloginfo( 'name', 'display' ) ), "home", get_bloginfo( 'name', 'display' ), $heading_elememt ); /** * Site description diaplay at header bar when if header text Display Text value is no. * * * * */ $raindrops_site_desctiption_html = '
        %s
        '; printf( $raindrops_site_desctiption_html, $raindrops_show_hide, get_bloginfo( 'description' ) ); /** * header image * * * * * */ echo raindrops_header_image(); echo $add_fluid_style_description_html; } } /** * Empty title fallback * * */ if ( !function_exists( 'raindrops_fallback_title' ) ) { function raindrops_fallback_title( $title, $id = 0 ) { global $post, $raindrops_link_unique_text; $format_label = ''; if ( 0 == $id && is_object( $post ) ) { $id = $post->ID; } if ( !is_admin() ) { $format = get_post_format( $id ); if ( false === $format ) { $image_uri = get_template_directory_uri() . '/images/link.png'; $class = 'icon-link-no-title'; $format_label = 'Article'; } else { $image_uri = get_template_directory_uri() . '/images/post-format-' . $format . '.png'; $class = 'icon-post-format-notitle icon-post-format-' . $format; if ( 'link' == $format ) { $add_label = ' to entry'; } else { $add_label = ''; } $format_label = 'Post Format ' . esc_attr( $format ) . $add_label; } if ( empty( $title ) ) { $html = ''; return $html; } } if ( isset( $post->ID ) && $raindrops_link_unique_text == true ) { $title = $title. raindrops_unique_entry_title( $post->ID ); } return apply_filters( 'raindrops_fallback_title', $title ); } } /** * * * * @since 1.139 */ ///////////////////////////////////test if ( !function_exists( 'raindrops_detect_header_image_size' ) ) { function raindrops_detect_header_image_size( $xy = 'width' ) { global $raindrops_custom_header_args; $all_header_images = array(); $header_image = get_custom_header(); $header_image_uri = $header_image->url; $header_image_basename = basename( $header_image_uri ); if ( $raindrops_custom_header_args[ "default-image" ] == $header_image_uri ) { if ( 'width' == $xy ) { return $raindrops_custom_header_args[ "width" ]; } elseif ( 'height' == $xy ) { return $raindrops_custom_header_args[ "height" ]; } } $all_header_images = get_uploaded_header_images(); if ( 'width' == $xy ) { if ( isset( $all_header_images[ $header_image_basename ][ 'width' ] ) ) { return $all_header_images[ $header_image_basename ][ 'width' ]; } else { return $header_image->width; } } elseif ( 'height' == $xy ) { if ( isset( $all_header_images[ $header_image_basename ][ 'height' ] ) ) { return $all_header_images[ $header_image_basename ][ 'height' ]; } else { return $header_image->height; } } return false; } } /** * Template function print header image * * This function has filter hook name raindrops_header_image * @param array( 'img'=> 'image uri' , 'height' => 'image height' , 'color' => 'text color', 'style' => '( default ) background-size:cover;' , 'description' => 'replace text from bloginfo( description ) to your text','description_style' => 'Your description style rule' ) * @return string htmlblock

        [WordPress site description]

        */ if ( !function_exists( 'raindrops_header_image' ) ) { function raindrops_header_image( $type = 'default', $args = array() ) { global $raindrops_page_width, $post; $raindrops_document_width = $raindrops_page_width; $raindrops_header_image = get_custom_header(); $raindrops_header_image_uri = $raindrops_header_image->url; $raindrops_header_image_width = raindrops_detect_header_image_size( 'width' ); $raindrops_header_image_height = raindrops_detect_header_image_size( 'height' ); $raindrops_restore_check = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) ); $raindrops_field_exists_check = get_post_custom_values( '_raindrops_this_header_image' ); if ( $raindrops_field_exists_check !== null ) { $display_header_image_file = get_post_meta( $post->ID, '_raindrops_this_header_image', true ); if ( $display_header_image_file == 'hide' && is_singular() ) { return; } if ( !empty( $display_header_image_file ) && $display_header_image_file !== 'default' && is_singular() ) { $display_header_image_attr = wp_get_attachment_image_src( $display_header_image_file, 'full' ); if ( ! empty( $display_header_image_attr ) ) { $raindrops_header_image_uri = $display_header_image_attr[ 0 ]; $raindrops_header_image_width = $display_header_image_attr[ 1 ]; $raindrops_header_image_height = $display_header_image_attr[ 2 ]; } } } if ( 'remove-header' == $raindrops_restore_check ) { return; } if ( empty( $raindrops_header_image_uri ) ) { $raindrops_header_image_uri = $raindrops_restore_check; } if ( $raindrops_header_image_width > 0 && $raindrops_header_image_height > 0 ) { $ratio = $raindrops_header_image_height / $raindrops_header_image_width; } else { $ratio = 0; } $raindrops_width = raindrops_warehouse_clone( 'raindrops_page_width' ); switch ( true ) { case 'doc' == $raindrops_width: $raindrops_document_width = 750; break; case 'doc2' == $raindrops_width: $raindrops_document_width = 950; break; case 'doc4' == $raindrops_width: $raindrops_document_width = 974; break; case is_numeric( $raindrops_width ): $raindrops_document_width = $raindrops_page_width; break; case 'doc3' == $raindrops_width: $raindrops_document_width = 950; //this value is fake following javascript break; } if ( $raindrops_header_image_width >= $raindrops_document_width ) { $height_current = round( $raindrops_document_width * $ratio ) . 'px'; $block_style = 'background-size:cover;'; } else { $height_current = round( $raindrops_header_image_height ) . 'px'; $block_style = 'background-repeat:no-repeat;background-position:center;background-color:#000;background-size:auto; background-origin:content-box;'; } if ( 'doc3' == $raindrops_width ) { $block_style = str_replace( 'background-size:auto', 'background-size:cover', $block_style ); } //w3standard can not use CSS3 if ( 'w3standard' == raindrops_warehouse( 'raindrops_style_type' ) ) { $block_style = 'background-repeat:no-repeat;background-position:center;background-color:#000;'; } if ( '' == get_header_image() ) { $height = 0; $description_style = ' style="display:none;"'; } $defaults = array( 'img' => $raindrops_header_image_uri, 'height' => $height_current, 'color' => get_theme_mod( 'header_textcolor' ), 'style' => $block_style, 'text' => get_bloginfo( 'description' ), 'text_attr' => '' ); $args = wp_parse_args( $args, $defaults ); extract( $args, EXTR_SKIP ); if ( 'blank' == get_theme_mod( 'header_textcolor' ) ) { $text_attr = ' style="display:none;"'; } elseif ( preg_match( "!([0-9a-f]{6}|[0-9a-f]{3})!si", get_theme_mod( 'header_textcolor' ) ) ) { $add_class = ''; $add_style = ''; if ( preg_match( '!style!', $text_attr ) ) { $add_style = str_replace( array( 'style', "'", '"', '=' ), '', $text_attr ); } else { $add_class = $text_attr; } $text_attr = ' style="color:#' . esc_attr( get_theme_mod( 'header_textcolor' ) ) . ';' . esc_attr( $add_style ) . '" ' . esc_html( $add_class ); $text_attr = apply_filters( 'raindrops_header_image_description_attr', $text_attr ); } if ( 'doc3' == Raindrops_warehouse_clone( "raindrops_page_width" ) ) { $width = 'width:100%'; } else { $width = 'width:' . $raindrops_document_width . 'px'; } if ( $type == 'default' || !isset( $type ) ) { $html = '

        %7$s

        '; $html = sprintf( $html, 'header-image', esc_url( $img ), esc_html( $height ), esc_html( $color ), esc_html( $style ), htmlspecialchars( $text_attr, ENT_NOQUOTES ), esc_html( $text ), $width ); if ( $color == 'blank' ) { $html = str_replace( 'color:#blank;', '', $html ); } return apply_filters( "raindrops_header_image", $html ); } elseif ( 'css' == $type ) { $css = '#%1$s{%2$s%8$s;height:%3$s;color:#%4$s;%5$s}' . "\n" . '#%1$s p {%6$s}'; $text_attr = str_replace( array( 'style', '=', '"', "'" ), '', $text_attr ); $css = sprintf( $css, 'header-image', apply_filters( 'raindrops_header_image_background_image', 'background-image:url( ' . esc_url( $img ) . ' );' ), esc_html( $height ), esc_html( $color ), apply_filters( 'raindrops_header_image_background_style', esc_html( $style ) ), // css needs > but this style is inline htmlspecialchars( $text_attr, ENT_NOQUOTES ), // css needs > but this style is inline esc_html( $text ), $width ); if ( $color == 'blank' ) { $css = str_replace( 'color:#blank;', '', $css ); } return apply_filters( "raindrops_header_image_css", $css ); } elseif ( 'elements' == $type ) { $elements = '
        ' . apply_filters( 'raindrops_header_image_contents', '' ) . '

        %2$s

        '; $elements = sprintf( $elements, 'header-image', esc_html( $text ), $text_attr ); return apply_filters( "raindrops_header_image_elements", $elements ); } elseif ( 'home_url' == $type ) { $elements = '
        ' . apply_filters( 'raindrops_header_image_contents', '' ) . '

        %2$s

        '; $elements = sprintf( $elements, 'header-image', esc_html( $text ), esc_url( home_url() ), $text_attr ); return apply_filters( "raindrops_header_image_home_url", $elements ); } } } /** * Print site description html * * This function has filter hook name raindrops_site_description * * @param array( "text" => 'Some text' , "switch" => ' style="display:none;"' ) * @return string htmlblock
        [input text]
        * */ if ( !function_exists( 'raindrops_site_description' ) ) { function raindrops_site_description( $args = array() ) { if ( 'blank' == get_theme_mod( 'header_textcolor' ) ) { $raindrops_show_hide = ''; } elseif ( preg_match( "!([0-9a-f]{6}|[0-9a-f]{3})!si", get_header_textcolor() ) ) { $raindrops_show_hide = ' style="display:none;"'; } else { $raindrops_show_hide = ' style="display:none;"'; } $defaults = array( 'text' => get_bloginfo( 'description' ), 'switch' => $raindrops_show_hide ); $args = wp_parse_args( $args, $defaults ); extract( $args, EXTR_SKIP ); $html = '
        %2$s
        '; $html = sprintf( $html, $switch, $text ); return apply_filters( "raindrops_site_description", $html ); } } /** * Print the site title * * This function has filter hook name raindrops_site_title( #site-title ) * * * @param $text string append to title strings * @return htmlblock <[h1|div] class="h1" id="site-title">[bloginfo( name )] */ if ( !function_exists( 'raindrops_site_title' ) ) { function raindrops_site_title( $text = "" ) { global $raindrops_document_type; if ( 'xhtml' == $raindrops_document_type ) { if ( is_home() || is_front_page() ) { $heading_elememt = 'h1'; } else { $heading_elememt = 'div'; } } else { $heading_elememt = 'h1'; } $header_text_color = get_theme_mod( 'header_textcolor' ); if ( 'blank' == $header_text_color || '' == $header_text_color ) { $hd_style = ''; } else { $hd_style = ' style="color:#' . $header_text_color . ';"'; } $title_format = '<%1$s class="%6$s" id="site-title">%5$s'; $html = sprintf( $title_format, $heading_elememt, home_url(), esc_attr( 'site title ' . get_bloginfo( 'name', 'display' ) ), "home", get_bloginfo( 'name', 'display' ) . esc_html( $text ), apply_filters( 'raindrops_site_title_class', 'h1' ) ); return apply_filters( "raindrops_site_title", $html ); } } /** * filter function for wp_title hook * element title */ if ( !function_exists( 'raindrops_filter_title' ) ) { function raindrops_filter_title( $title, $sep = true, $seplocation = 'right' ) { global $page, $paged; $page_info = ''; $add_title = array(); $site_description = get_bloginfo( 'description', 'display' ); if ( !empty( $title ) ) { $add_title[] = str_replace( $sep, '', $title ); } $add_title[] = get_bloginfo( 'name' ); if ( !empty( $site_description ) && ( is_home() || is_front_page() ) ) { $add_title[] = $site_description; } // Add a page number if ( $paged > 1 || $page > 1 ) { $page_info = sprintf( esc_html__( ' Page %s', 'Raindrops' ), max( $paged, $page ) ); } if ( 'right' == $seplocation ) { $add_title = array_reverse( $add_title ); $title = implode( " $sep ", $add_title ) . $page_info; } else { $title = implode( " $sep ", $add_title ) . $page_info; } return $title; } } /** * * * * * */ if ( !function_exists( "raindrops_show_one_column" ) ) { function raindrops_show_one_column() { global $post; if ( isset( $post ) ) { $raindrops_content_check = get_post( $post->ID ); $raindrops_content_check = $raindrops_content_check->post_content; if ( preg_match( "!\[raindrops[^\]]+(col)=(\"|')*?([^\"' ]+)(\"|')*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) { return $regs[ 3 ]; } else { return false; } } elseif ( 'hide' == Raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) ) { return 2; } elseif ( 'show' == Raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) ) { return 3; } } } /** * * * * * */ if ( !function_exists( "raindrops_color_type_custom" ) ) { function raindrops_color_type_custom( $css ) { global $post; if ( isset( $post ) && is_singular() ) { $raindrops_content_check = get_post( $post->ID ); $raindrops_content_check = $raindrops_content_check->post_content; if ( preg_match( "!\[raindrops[^\]]+(color_type)=(\"|')*?([^\"' ]+)(\"|')*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) { $color_type = trim( $regs[ 3 ] ); return raindrops_design_output( $color_type ) . raindrops_color_base(); } else { return $css; } }elseif( intval( get_query_var( 'raindrops_color_type' ) ) == 1 && $post_id = get_query_var( 'p' ) ) { //&& $raindrops_new_style_load == true $raindrops_content_check = get_post( $post_id ); $raindrops_content_check = $raindrops_content_check->post_content; if ( preg_match( "!\[raindrops[^\]]+(color_type)=(\"|')*?([^\"' ]+)(\"|')*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) { $color_type = trim( $regs[ 3 ] ); return raindrops_design_output( $color_type ) . raindrops_color_base(); } else { return $css; } }else{ return $css; } } } /** * * * * * */ if ( !function_exists( "raindrops_delete_post_link" ) ) { function raindrops_delete_post_link( $link_text = null, $before = '', $after = '', $id = 0, $echo = true ) { global $post; if ( RAINDROPS_SHOW_DELETE_POST_LINK !== true ) { return; } if ( empty( $link_text ) ) { $link_text = esc_html__( 'Trash', 'Raindrops' ); } if ( current_user_can( 'edit_post', $post->ID ) && $url = get_delete_post_link() ) { $html = $before . '%2$s' . $after; $html = sprintf( $html, $url, $link_text ); if ( $echo !== true ) { return $html; } else { echo $html; } } } } /** * comment reply * * * * @since 0.956 */ if ( !function_exists( "raindrops_enqueue_comment_reply" ) ) { function raindrops_enqueue_comment_reply() { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } } //add_filter( 'the_content', 'raindrops_fallback_human_interface' ); //add_filter( 'raindrops_posted_in', 'raindrops_fallback_human_interface' ); /** * * * * * @since 0.958 */ if ( !function_exists( "raindrops_fallback_human_interface" ) ) { function raindrops_fallback_human_interface( $content ) { if ( ( is_home() || is_front_page() ) && true == small_screen_check() ) { return; } else { return $content; } } } /** * * * * * @since 0.958 */ if ( !function_exists( "small_screen_check" ) ) { function small_screen_check() { global $raindrops_fluid_minimum_width, $raindrops_fallback_human_interface_show; $size = ''; if ( isset( $_SERVER[ 'HTTP_UA_PIXELS' ] ) && !empty( $_SERVER[ 'HTTP_UA_PIXELS' ] ) ) { $size = $_SERVER[ 'HTTP_UA_PIXELS' ]; } if ( isset( $_SERVER[ 'HTTP_X_UP_DEVCAP_SCREENPIXELS' ] ) && !empty( $_SERVER[ 'HTTP_X_UP_DEVCAP_SCREENPIXELS' ] ) ) { $size = $_SERVER[ 'HTTP_X_UP_DEVCAP_SCREENPIXELS' ]; } if ( isset( $_SERVER[ 'HTTP_X_JPHONE_DISPLAY' ] ) && !empty( $_SERVER[ 'HTTP_X_JPHONE_DISPLAY' ] ) ) { $size = $_SERVER[ 'HTTP_X_JPHONE_DISPLAY' ]; } $size = preg_split( '[x,*]', $size ); if ( true == $raindrops_fallback_human_interface_show ) { return true; } if ( isset( $size[ 0 ] ) && is_numeric( $size[ 0 ] ) ) { if ( $size[ 0 ] < $raindrops_fluid_minimum_width ) { return true; } else { return false; } } return false; } } /** * * * * * @since 0.958 */ if ( !function_exists( "raindrops_fallback_user_interface_view" ) ) { function raindrops_fallback_user_interface_view() { global $raindrops_current_theme_name, $raindrops_current_data_version; wp_deregister_style( 'style' ); wp_deregister_style( 'raindrops_reset_fonts_grids' ); wp_deregister_style( 'raindrops_grids' ); wp_deregister_style( 'raindrops_fonts' ); wp_deregister_style( 'raindrops_css3' ); wp_deregister_style( 'child' ); $current_theme = $raindrops_current_theme_name; $fallback_style = get_template_directory_uri() . '/fallback.css'; wp_register_style( 'fallback_style', $fallback_style, array(), $raindrops_current_data_version, 'all' ); wp_enqueue_style( 'fallback_style' ); add_filter( 'raindrops_indv_css', '__return_false' ); add_filter( 'raindrops_is_fluid', '__return_false' ); add_filter( 'raindrops_is_fixed', '__return_false' ); add_filter( 'raindrops_embed_meta_css', '__return_false' ); } if ( small_screen_check() == true ) { add_action( 'wp_print_styles', 'raindrops_fallback_user_interface_view', 99 ); add_action( 'wp_head', 'raindrops_mobile_meta' ); } } /** * * * * */ if ( !function_exists( 'raindrops_load_small_device_helper' ) ) { /** * * @global type $raindrops_current_data_version * @global type $is_IE * @global type $raindrops_fluid_maximum_width * @global type $raindrops_browser_detection * @global type $post * @global type $template * @global type $raindrops_link_unique_text * @since 1.254 */ function raindrops_load_small_device_helper() { global $raindrops_current_data_version, $is_IE, $raindrops_fluid_maximum_width, $raindrops_browser_detection, $post, $template, $raindrops_link_unique_text; $raindrops_header_image = get_custom_header(); $raindrops_header_image_uri = $raindrops_header_image->url; $ratio = 0; if ( empty( $raindrops_header_image_uri ) ) { $raindrops_header_image_uri = get_header_image(); } $raindrops_header_image_width = raindrops_detect_header_image_size( 'width' ); $raindrops_header_image_height = raindrops_detect_header_image_size( 'height' ); $raindrops_field_exists_check = get_post_custom_values( '_raindrops_this_header_image' ); if ( $raindrops_field_exists_check !== null ) { $display_header_image_file = get_post_meta( $post->ID, '_raindrops_this_header_image', true ); if ( !empty( $display_header_image_file ) && $display_header_image_file !== 'default' && is_singular() ) { $display_header_image_attr = wp_get_attachment_image_src( $display_header_image_file, 'full' ); if ( ! empty( $display_header_image_attr ) ) { $raindrops_header_image_uri = $display_header_image_attr[ 0 ]; $raindrops_header_image_width = $display_header_image_attr[ 1 ]; $raindrops_header_image_height = $display_header_image_attr[ 2 ]; } } } $raindrops_restore_check = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) ); if ( $raindrops_restore_check !== 'remove-header' ) { if ( $raindrops_header_image_width > 0 && $raindrops_header_image_height > 0 ) { $ratio = $raindrops_header_image_height / $raindrops_header_image_width; } else { $ratio = 0; } } $raindrops_current_template = basename( $template, '.php' ); if ( $raindrops_current_template == 'list_of_post' ) { $raindrops_ignore_template = true; } else { $raindrops_ignore_template = false; } if ( is_single() || is_page() ) { $color_type = ''; $raindrops_content_check = get_post( $post->ID ); $raindrops_content_check = $raindrops_content_check->post_content; if ( preg_match( "!\[raindrops[^\]]+(color_type)=(\"|')*?([^\"' ]+)(\"|' )*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) { $color_type = "rd-type-" . trim( $regs[ 3 ] ); } if ( preg_match( "!\[raindrops[^\]]+(col)=(\"|')*?([^\"' ]+)(\"|')*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) { $color_type .= ' '; $color_type .= "rd-col-" . $regs[ 3 ]; } } else { $raindrops_options = get_option( "raindrops_theme_settings" ); if ( isset( $raindrops_options[ "raindrops_style_type" ] ) && !empty( $raindrops_options[ "raindrops_style_type" ] ) ) { } } $color_type = ''; if ( isset( $post->ID ) ) { $raindrops_content_check = get_post( $post->ID ); } if ( isset( $raindrops_content_check ) ) { $raindrops_content_check = $raindrops_content_check->post_content; if ( preg_match( "!\[raindrops[^\]]+(color_type)=(\"|')*?([^\"' ]+)(\"|' )*?[^\]]*\]!si", $raindrops_content_check, $regs ) && is_singular() ) { $color_type = "rd-type-" . trim( $regs[ 3 ] ); } if ( preg_match( "!\[raindrops[^\]]+(col)=(\"|')*?([^\"' ]+)(\"|')*?[^\]]*\]!si", $raindrops_content_check, $regs ) && is_singular() ) { $color_type .= ' '; $color_type .= "rd-col-" . $regs[ 3 ]; } } else { $raindrops_options = get_option( "raindrops_theme_settings" ); if ( isset( $raindrops_options[ "raindrops_style_type" ] ) && !empty( $raindrops_options[ "raindrops_style_type" ] ) ) { $color_type = "rd-type-" . $raindrops_options[ "raindrops_style_type" ]; } } $raindrops_page_width = raindrops_warehouse_clone( 'raindrops_page_width' ); wp_enqueue_script( 'raindrops_helper_script', get_template_directory_uri() . '/raindrops-helper.js', array( 'jquery' ),$raindrops_current_data_version, true ); if( $raindrops_browser_detection == true ){ $raindrops_browser_detection = 1; }else{ $raindrops_browser_detection = 0; } if( is_singular() == true ) { $raindrops_is_singular = 1; }else{ $raindrops_is_singular = 0; } if( is_single() == true ) { $raindrops_is_single = 1; }else{ $raindrops_is_single = 0; } if( is_page() == true ) { $raindrops_is_page = 1; }else{ $raindrops_is_page = 0; } wp_localize_script( 'raindrops_helper_script', 'raindrops_script_vars', array( 'is_ie' => $is_IE, 'fluid_maximum_width' => $raindrops_fluid_maximum_width, 'browser_detection' => $raindrops_browser_detection , 'post' => $post, 'template' => $template, 'link_unique_text' => $raindrops_link_unique_text, 'header_image_uri' => $raindrops_header_image_uri, 'header_image_width' => $raindrops_header_image_width, 'header_image_height' => $raindrops_header_image_height, 'field_exists_check' => $raindrops_field_exists_check, 'restore_check' => $raindrops_restore_check, 'ratio' => apply_filters( 'raindrops_header_image_ratio', $ratio ), 'current_template' => $raindrops_current_template, 'ignore_template' => $raindrops_ignore_template, 'is_single' => $raindrops_is_single, 'is_page' => $raindrops_is_page, 'is_singular' => $raindrops_is_singular, 'browser_detection' => $raindrops_browser_detection, 'color_type' => $color_type, 'page_width' => $raindrops_page_width, 'accessibility_settings' =>raindrops_warehouse_clone( 'raindrops_accessibility_settings' ), ) ); } } /** * * * * * */ if ( !function_exists( 'raindrops_custom_width' ) ) { function raindrops_custom_width() { global $raindrops_page_width; $c_width = (int) $raindrops_page_width; $width = $c_width / 13; $ie_width = $width * 0.9759; return "/* test: $c_width */"; $custom_content_width = '/* set custom content width start */' . '#custom-doc {margin:auto;text-align:left;' . "\n" . 'width:' . round( $width, 0 ) . 'em;' . "\n" . '*width:' . round( $ie_width, 0 ) . 'em;' . "\n" . 'min-width:' . round( $width * 0.7, 0 ) . 'em;}/* set custom content width end */'; return apply_filters( "raindrops_custom_width", $custom_content_width ); } } /** * * * * * */ if ( !function_exists( 'raindrops_is_fluid' ) ) { function raindrops_is_fluid() { global $is_IE, $raindrops_fluid_minimum_width, $raindrops_fluid_maximum_width; $width = intval( $raindrops_fluid_minimum_width ); $extra_sidebar_width = raindrops_warehouse_clone( 'raindrops_right_sidebar_width_percent' ); if ( '25' == $extra_sidebar_width ) { $main_column_width_fluid = 74.2; } elseif ( '75' == $extra_sidebar_width ) { $main_column_width_fluid = 24; } elseif ( '33' == $extra_sidebar_width ) { $main_column_width_fluid = 64; } elseif ( '66' == $extra_sidebar_width ) { $main_column_width_fluid = 32; } elseif ( '50' == $extra_sidebar_width ) { $main_column_width_fluid = 49; } else { $main_column_width_fluid = 100; } if ( 'show' !== raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ) ) { $main_column_width_fluid = 100; } $fluid_width = '/* raindrops is fluid start */' . "\n#doc3{min-width:" . $raindrops_fluid_minimum_width . 'px;max-width:' . $raindrops_fluid_maximum_width . 'px;}' . "\n#container > .first{width:" . $main_column_width_fluid . "%;}" . "\n#access{min-width:" . $raindrops_fluid_minimum_width . 'px;}'."\n".'/* raindrops is fluid end */'; return apply_filters( "raindrops_is_fluid", $fluid_width ); } } if ( !function_exists( 'raindrops_is_fixed' ) ) { function raindrops_is_fixed() { global $is_IE, $raindrops_page_width, $raindrops_base_font_size; $add_ie = ''; $pw = raindrops_warehouse_clone( "raindrops_page_width" ); $raindrops_base_font_size = apply_filters( 'raindrops_base_font_size', $raindrops_base_font_size ); //px size if ( 'doc' == $pw ) { $width = 750; $px = 'max-width:' . $width . 'px;'; $width = $width / $raindrops_base_font_size; } if ( 'doc2' == $pw ) { $width = 950; $px = 'max-width:' . $width . 'px;'; $width = $width / $raindrops_base_font_size; } if ( 'doc4' == $pw ) { $width = 974; $px = 'max-width:' . $width . 'px;'; $width = $width / $raindrops_base_font_size; } if ( 'custom-doc' == $pw ) { $width = $raindrops_page_width; $px = 'width:' . $width . 'px;'; $width = $width / $raindrops_base_font_size; } $raindrops_main_width = raindrops_main_width(); $raindrops_main_width = $raindrops_main_width / $raindrops_base_font_size; if ( $is_IE ) { $width = round( $width * 0.9759, 1 ); $add_ie = ''; $raindrops_main_width = round( $raindrops_main_width * 0.9759, 1 ); } else { $width = round( $width, 1 ); $raindrops_main_width = round( $raindrops_main_width, 1 ); } $custom_fixed_width = '/* raindrops is fixed start*/' . " \n#" . $pw . '{margin:auto;text-align:left;' . "\n" . 'width:' . $width . 'em;' . $add_ie . $px . '}' . "\n#container{width:" . $raindrops_main_width . 'em;}/* raindrops is fixed end */'; return apply_filters( "raindrops_is_fixed", $custom_fixed_width ); } } /** * * * * * */ add_filter( 'raindrops_embed_meta_css', 'raindrops_add_gallery_css'); if ( !function_exists( 'raindrops_add_gallery_css' ) ) { function raindrops_add_gallery_css( $css ) { return $css. raindrops_gallerys(); } } if ( !function_exists( 'raindrops_gallerys' ) ) { function raindrops_gallerys() { $raindrops_gallerys = raindrops_gallerys_clone(); if ( WP_DEBUG !== true ) { $raindrops_gallerys = str_replace( array( "\n", "\r", "\t", '"', '--', '\"' ), array( "", "", "", '"', '', '"' ), $raindrops_gallerys ); } return apply_filters( "raindrops_gallerys_css", $raindrops_gallerys ); } } /** * * * * * @since 0.965 */ add_action( 'customize_register', 'raindrops_customize_register' ); /** * * * * */ if ( !function_exists( 'raindrops_customize_register' ) ) { function raindrops_customize_register( $wp_customize ) { global $raindrops_current_theme_name, $raindrops_base_setting_args, $raindrops_base_font_size; $raindrops_theme_name = wp_get_theme(); $wp_customize->add_section( 'raindrops_theme_settings', array( 'title' => esc_html__( 'Color Scheme', 'Raindrops' ), 'priority' => 26, ) ); $wp_customize->add_section( 'raindrops_theme_settings_sidebar', array( 'title' => esc_html__( 'Sidebars', 'Raindrops' ), 'priority' => 27, ) ); $wp_customize->add_section( 'raindrops_theme_settings_fonts', array( 'title' => esc_html__( 'Fonts', 'Raindrops' ), 'priority' => 28, ) ); $wp_customize->add_section( 'raindrops_theme_settings_document', array( 'title' => esc_html__( 'Document', 'Raindrops' ), 'priority' => 25, ) ); $wp_customize->add_section( 'raindrops_theme_settings_content', array( 'title' => esc_html__( 'Post Content Types', 'Raindrops' ), 'priority' => 29, ) ); $wp_customize->add_section( 'raindrops_theme_settings_plugins', array( 'title' => esc_html__( 'Recommend Plugins Presentation', 'Raindrops' ), 'priority' => 30, ) ); $wp_customize->add_section( 'raindrops_theme_settings_uninstall', array( 'title' => esc_html__( 'Uninstall Option', 'Raindrops' ), 'priority' => 99, ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_style_type]', array( 'default' => raindrops_warehouse_clone( 'raindrops_style_type' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_style_type_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_page_width]', array( 'default' => raindrops_warehouse_clone( 'raindrops_page_width' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_page_width_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_base_color]', array( 'default' => raindrops_warehouse_clone( 'raindrops_base_color' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_base_color_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_show_right_sidebar]', array( 'default' => raindrops_warehouse_clone( 'raindrops_show_right_sidebar' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_show_right_sidebar_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_col_width]', array( 'default' => raindrops_warehouse_clone( 'raindrops_col_width' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_col_width_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_show_menu_primary]', array( 'default' => raindrops_warehouse_clone( 'raindrops_show_menu_primary' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_show_menu_primary_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_default_fonts_color]', array( 'default' => '', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_default_fonts_color_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_hyperlink_color]', array( 'default' => '', 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_hyperlink_color_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_complementary_color_for_title_link]', array( 'default' => raindrops_warehouse_clone( 'raindrops_complementary_color_for_title_link' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_complementary_color_for_title_link_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_doc_type_settings]', array( 'default' => raindrops_warehouse_clone( 'raindrops_doc_type_settings' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_doc_type_settings_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_footer_color]', array( 'default' => raindrops_warehouse_clone( 'raindrops_footer_color' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_footer_color_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_accessibility_settings]', array( 'default' => raindrops_warehouse_clone( 'raindrops_accessibility_settings' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_accessibility_settings_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_plugin_presentation_bcn_nav_menu]', array( 'default' => raindrops_warehouse_clone( 'raindrops_plugin_presentation_bcn_nav_menu' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_plugin_presentation_bcn_nav_menu_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_plugin_presentation_wp_pagenav]', array( 'default' => raindrops_warehouse_clone( 'raindrops_plugin_presentation_wp_pagenav' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_plugin_presentation_wp_pagenav_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_plugin_presentation_meta_slider]', array( 'default' => raindrops_warehouse_clone( 'raindrops_plugin_presentation_meta_slider' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_plugin_presentation_meta_slider_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_plugin_presentation_the_events_calendar]', array( 'default' => raindrops_warehouse_clone( 'raindrops_plugin_presentation_the_events_calendar' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_plugin_presentation_the_events_calendar_validate' ) ); if ( RAINDROPS_USE_LIST_EXCERPT !== false ) { $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_entry_content_is_home]', array( 'default' => raindrops_warehouse_clone( 'raindrops_entry_content_is_home' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_entry_content_is_home_validate' ) ); //$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_entry_content_is_category]', array( 'default' => raindrops_warehouse_clone( 'raindrops_entry_content_is_category' ), 'type' => 'option', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_entry_content_is_category]', array( 'default' => raindrops_warehouse_clone( 'raindrops_entry_content_is_category' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_entry_content_is_category_validate' ) ); //$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_entry_content_is_search]', array( 'default' => raindrops_warehouse_clone( 'raindrops_entry_content_is_search' ), 'type' => 'option', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_entry_content_is_search]', array( 'default' => raindrops_warehouse_clone( 'raindrops_entry_content_is_search' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_entry_content_is_search_validate' ) ); } //$wp_customize->add_setting( 'raindrops_theme_settings[raindrops_footer_link_color]', array( 'default' => raindrops_warehouse_clone( 'raindrops_footer_link_color' ), 'type' => 'option', 'capability' => 'edit_theme_options', ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_footer_link_color]', array( 'default' => raindrops_warehouse_clone( 'raindrops_footer_link_color' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_footer_link_color_validate' ) ); $raindrops_font_max_size = 20; if ( isset( $raindrops_base_font_size ) ) { $raindrops_basefont_default_val = absint( $raindrops_base_font_size ); $raindrops_basefont_size = array(); for ( $i = $raindrops_basefont_default_val; $i < $raindrops_font_max_size + 1; $i++ ) { $font_size_key = "{$i}px"; $raindrops_basefont_size[ $font_size_key ] = $i; } } else { $raindrops_basefont_default_val = raindrops_warehouse_clone( 'raindrops_basefont_settings' ); $raindrops_basefont_size = array(); for ( $i = 13; $i < $raindrops_font_max_size + 1; $i++ ) { $font_size_key = "{$i}px"; $raindrops_basefont_size[ $font_size_key ] = $i; } } $raindrops_style_type_choices = raindrops_register_styles( "w3standard" ); $raindrops_col_width = array( esc_html__( "left 160px", 'Raindrops' ) => "t1", esc_html__( "left 180px", 'Raindrops' ) => "t2", esc_html__( "left 300px", 'Raindrops' ) => "t3", esc_html__( "right 180px", 'Raindrops' ) => "t4", esc_html__( "right 240px", 'Raindrops' ) => "t5", esc_html__( "right 300px", 'Raindrops' ) => "t6" ); $raindrops_extra_col_width = array( esc_html__( "25%", 'Raindrops' ) => "25", esc_html__( "33%", 'Raindrops' ) => "33", esc_html__( "50%", 'Raindrops' ) => "50", esc_html__( "66%", 'Raindrops' ) => "66", esc_html__( "75%", 'Raindrops' ) => "75" ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_basefont_settings]', array( 'default' => $raindrops_basefont_default_val, 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_basefont_settings_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_right_sidebar_width_percent]', array( 'default' => raindrops_warehouse_clone( 'raindrops_right_sidebar_width_percent' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_right_sidebar_width_percent_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_fluid_max_width]', array( 'default' => raindrops_warehouse_clone( 'raindrops_fluid_max_width' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_fluid_max_width_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_disable_keyboard_focus]', array( 'default' => raindrops_warehouse_clone( 'raindrops_disable_keyboard_focus' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_disable_keyboard_focus_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_sync_style_for_tinymce]', array( 'default' => raindrops_warehouse_clone( 'raindrops_sync_style_for_tinymce' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_sync_style_for_tinymce_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_uninstall_option]', array( 'default' => raindrops_warehouse_clone( 'raindrops_uninstall_option' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_uninstall_option_validate' ) ); $wp_customize->add_setting( 'raindrops_theme_settings[raindrops_menu_primary_font_size]', array( 'default' => raindrops_warehouse_clone( 'raindrops_menu_primary_font_size' ), 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'raindrops_menu_primary_font_size_validate' ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_base_color', array( 'label' => esc_html__( 'Base color', 'Raindrops' ), 'section' => 'raindrops_theme_settings', 'settings' => 'raindrops_theme_settings[raindrops_base_color]' ) ) ); $wp_customize->add_control( 'raindrops_style_type', array( 'label' => esc_html__( 'Color Type', 'Raindrops' ), 'section' => 'raindrops_theme_settings', 'settings' => 'raindrops_theme_settings[raindrops_style_type]', 'type' => 'radio', 'choices' => $raindrops_style_type_choices, ) ); $wp_customize->add_control( 'raindrops_doc_type_settings', array( 'label' => esc_html__( 'Document Type Definition', 'Raindrops' ), 'section' => 'raindrops_theme_settings_document', 'settings' => 'raindrops_theme_settings[raindrops_doc_type_settings]', 'type' => 'radio', 'choices' => array( 'html5' => 'HTML5', 'xhtml' => 'XHTML1.0', ), ) ); $wp_customize->add_control( 'raindrops_accessibility_settings', array( 'label' => esc_html__( 'Force Unique Link Text', 'Raindrops' ), 'section' => 'raindrops_theme_settings_document', 'settings' => 'raindrops_theme_settings[raindrops_accessibility_settings]', 'type' => 'radio', 'choices' => array( 'no' => 'No', 'yes' => 'Yes', ), ) ); $wp_customize->add_control( 'raindrops_page_width', array( 'label' => esc_html__( 'Document Width', 'Raindrops' ), 'section' => 'raindrops_theme_settings_document', 'settings' => 'raindrops_theme_settings[raindrops_page_width]', 'type' => 'radio', 'choices' => array( 'doc' => esc_html__( '750px Fixed Layout', 'Raindrops' ), 'doc2' => esc_html__( '950px Fixed Layout', 'Raindrops' ), 'doc3' => esc_html__( 'Fluid Responsive Layout', 'Raindrops' ), 'doc4' => esc_html( '974px Fixed Layout', 'Raindrops' ), ), ) ); $wp_customize->add_control( 'raindrops_col_width', array( 'label' => esc_html__( 'Default Sidebar', 'Raindrops' ), 'section' => 'raindrops_theme_settings_sidebar', 'settings' => 'raindrops_theme_settings[raindrops_col_width]', 'type' => 'radio', 'choices' => array_flip( $raindrops_col_width ), ) ); $wp_customize->add_control( 'raindrops_disable_keyboard_focus', array( 'label' => esc_html__( 'Disable Keyboad Focus', 'Raindrops' ), 'section' => 'raindrops_theme_settings_document', 'settings' => 'raindrops_theme_settings[raindrops_disable_keyboard_focus]', 'type' => 'radio', 'choices' => array( 'disable' => esc_html__( 'Disable', 'Raindrops' ), 'enable' => esc_html__( 'Enable', 'Raindrops' ), ), ) ); $wp_customize->add_control( 'raindrops_show_right_sidebar', array( 'label' => esc_html__( 'Display Extra Sidebar', 'Raindrops' ), 'section' => 'raindrops_theme_settings_sidebar', 'settings' => 'raindrops_theme_settings[raindrops_show_right_sidebar]', 'type' => 'radio', 'choices' => array( 'show' => esc_html__( 'Show', 'Raindrops' ), 'hide' => esc_html__( 'Hide', 'Raindrops' ), ), ) ); $wp_customize->add_control( 'raindrops_right_sidebar_width_percent', array( 'label' => esc_html__( 'Extra Sidebar Width', 'Raindrops' ), 'section' => 'raindrops_theme_settings_sidebar', 'settings' => 'raindrops_theme_settings[raindrops_right_sidebar_width_percent]', 'type' => 'radio', 'choices' => array_flip( $raindrops_extra_col_width ), ) ); $wp_customize->add_control( 'raindrops_show_menu_primary', array( 'label' => esc_html__( 'Display hide', 'Raindrops' ), 'section' => 'nav', 'settings' => 'raindrops_theme_settings[raindrops_show_menu_primary]', 'type' => 'radio', 'choices' => array( 'show' => 'Show', 'hide' => 'Hide', ), ) ); $wp_customize->add_control( 'raindrops_fluid_max_width', array( 'label' => esc_html__( 'Fluid Max Width (px)', 'Raindrops' ), 'section' => 'raindrops_theme_settings_document', 'settings' => 'raindrops_theme_settings[raindrops_fluid_max_width]', 'type' => 'text', ) ); if ( RAINDROPS_USE_LIST_EXCERPT !== false ) { $wp_customize->add_control( 'raindrops_entry_content_is_home', array( 'label' => esc_html__( 'Home Listed Entry Contents', 'Raindrops' ), 'section' => 'raindrops_theme_settings_content', 'settings' => 'raindrops_theme_settings[raindrops_entry_content_is_home]', 'type' => 'radio', 'choices' => array( 'content' => esc_html__( 'Show Content', 'Raindrops' ), 'excerpt' => esc_html__( 'Show Excerpt', 'Raindrops' ), 'none' => esc_html__( 'Hide', 'Raindrops' ), ) ) ); $wp_customize->add_control( 'raindrops_entry_content_is_category', array( 'label' => esc_html__( 'Category Archives Entry Contents', 'Raindrops' ), 'section' => 'raindrops_theme_settings_content', 'settings' => 'raindrops_theme_settings[raindrops_entry_content_is_category]', 'type' => 'radio', 'choices' => array( 'content' => esc_html__( 'Show Content', 'Raindrops' ), 'excerpt' => esc_html__( 'Show Excerpt', 'Raindrops' ), 'none' => esc_html__( 'Hide', 'Raindrops' ), ) ) ); $wp_customize->add_control( 'raindrops_entry_content_is_search', array( 'label' => esc_html__( 'Search Result Entry Contents', 'Raindrops' ), 'section' => 'raindrops_theme_settings_content', 'settings' => 'raindrops_theme_settings[raindrops_entry_content_is_search]', 'type' => 'radio', 'choices' => array( 'content' => esc_html__( 'Show Content', 'Raindrops' ), 'excerpt' => esc_html__( 'Show Excerpt', 'Raindrops' ), 'none' => esc_html__( 'Hide', 'Raindrops' ), ) ) ); } /* * font color */ $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_default_fonts_color2', array( 'label' => esc_html__( 'Font Color', 'Raindrops' ), 'section' => 'colors', 'settings' => 'raindrops_theme_settings[raindrops_default_fonts_color]' ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_footer_color2', array( 'label' => esc_html__( 'Footer Font Color', 'Raindrops' ), 'section' => 'colors', 'settings' => 'raindrops_theme_settings[raindrops_footer_color]' ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_footer_link_color2', array( 'label' => esc_html__( 'Footer Link Color', 'Raindrops' ), 'section' => 'colors', 'settings' => 'raindrops_theme_settings[raindrops_footer_link_color]' ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_hyperlink_color2', array( 'label' => esc_html__( 'Link Color', 'Raindrops' ), 'section' => 'colors', 'settings' => 'raindrops_theme_settings[raindrops_hyperlink_color]' ) ) ); $wp_customize->add_control( 'raindrops_complementary_color_for_title_link2', array( 'label' => esc_html__( 'Complementary Link Color For Entry Title', 'Raindrops' ), 'section' => 'colors', 'settings' => 'raindrops_theme_settings[raindrops_complementary_color_for_title_link]', 'type' => 'radio', 'choices' => array( 'yes' => 'Yes', 'no' => 'no' ), ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_default_fonts_color', array( 'label' => esc_html__( 'Font Color', 'Raindrops' ), 'section' => 'raindrops_theme_settings_fonts', 'settings' => 'raindrops_theme_settings[raindrops_default_fonts_color]' ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_hyperlink_color', array( 'label' => esc_html__( 'Link Color', 'Raindrops' ), 'section' => 'raindrops_theme_settings_fonts', 'settings' => 'raindrops_theme_settings[raindrops_hyperlink_color]' ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_footer_color', array( 'label' => esc_html__( 'Footer Font Color', 'Raindrops' ), 'section' => 'raindrops_theme_settings_fonts', 'settings' => 'raindrops_theme_settings[raindrops_footer_color]' ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'raindrops_footer_link_color', array( 'label' => esc_html__( 'Footer Link Color', 'Raindrops' ), 'section' => 'raindrops_theme_settings_fonts', 'settings' => 'raindrops_theme_settings[raindrops_footer_link_color]' ) ) ); $wp_customize->add_control( 'raindrops_complementary_linkcolor_for_title_link', array( 'label' => esc_html__( 'Complementary Link Color For Entry Title', 'Raindrops' ), 'section' => 'raindrops_theme_settings_fonts', 'settings' => 'raindrops_theme_settings[raindrops_complementary_color_for_title_link]', 'type' => 'radio', 'choices' => array( 'yes' => 'Yes', 'no' => 'no' ), ) ); $wp_customize->add_control( 'raindrops_basefont_settings', array( 'label' => esc_html__( 'Base Font Size', 'Raindrops' ), 'section' => 'raindrops_theme_settings_fonts', 'settings' => 'raindrops_theme_settings[raindrops_basefont_settings]', 'type' => 'radio', 'choices' => array_flip( $raindrops_basefont_size ), ) ); if ( 'yes' == get_theme_mod( 'raindrops_breadcrumb_navxt_status' ) ) { $wp_customize->add_control( 'raindrops_plugin_presentation_bcn_nav_menu', array( 'label' => esc_html__( 'Breadcrumb NavXT Automatic Presentation', 'Raindrops' ), 'section' => 'raindrops_theme_settings_plugins', 'settings' => 'raindrops_theme_settings[raindrops_plugin_presentation_bcn_nav_menu]', 'type' => 'radio', 'choices' => array( 'yes' => 'Yes', 'none' => 'no' ), ) ); } if ( 'yes' == get_theme_mod( 'raindrops_wp_pagenavi_status' ) ) { $wp_customize->add_control( 'raindrops_plugin_presentation_wp_pagenav', array( 'label' => esc_html__( 'WP PageNavi Automatic Presentation', 'Raindrops' ), 'section' => 'raindrops_theme_settings_plugins', 'settings' => 'raindrops_theme_settings[raindrops_plugin_presentation_wp_pagenav]', 'type' => 'radio', 'choices' => array( 'yes' => 'Yes', 'none' => 'no' ), ) ); } if ( 'yes' == get_theme_mod( 'raindrops_ml_slider_status' ) ) { $wp_customize->add_control( 'raindrops_plugin_presentation_meta_slider', array( 'label' => esc_html__( 'Meta Slider ID for HomePage', 'Raindrops' ), 'section' => 'raindrops_theme_settings_plugins', 'settings' => 'raindrops_theme_settings[raindrops_plugin_presentation_meta_slider]', 'type' => 'text', ) ); } if ( 'yes' == get_theme_mod( 'raindrops_the_events_calendar_status' ) ) { $wp_customize->add_control( 'raindrops_plugin_presentation_the_events_calendar', array( 'label' => esc_html__( 'The Events Calendar Automatic Presentation', 'Raindrops' ), 'section' => 'raindrops_theme_settings_plugins', 'settings' => 'raindrops_theme_settings[raindrops_plugin_presentation_the_events_calendar]', 'type' => 'radio', 'choices' => array( 'yes' => 'Yes', 'none' => 'no' ), ) ); } $wp_customize->add_control( 'raindrops_sync_style_for_tinymce', array( 'label' => esc_html__( 'Synchronize Style for Visual Editor', 'Raindrops' ), 'section' => 'raindrops_theme_settings', 'settings' => 'raindrops_theme_settings[raindrops_sync_style_for_tinymce]', 'type' => 'radio', 'choices' => array( 'yes' => 'Yes', 'none' => 'No' ), ) ); $wp_customize->add_control( 'raindrops_uninstall_option', array( 'label' => esc_html__( 'Delete all Theme Settings when Switch Theme', 'Raindrops' ), 'section' => 'raindrops_theme_settings_uninstall', 'settings' => 'raindrops_theme_settings[raindrops_uninstall_option]', 'type' => 'radio', 'choices' => array( 'keep' => 'Keep', 'delete' => 'Delete All' ), 'description' => ''. esc_html__( 'The deleted data can not be restored', 'Raindrops' ). '', ) ); $wp_customize->add_control( 'raindrops_menu_primary_font_size', array( 'label' => esc_html__( 'Menu Primary Font Size', 'Raindrops' ), 'section' => 'nav', 'settings' => 'raindrops_theme_settings[raindrops_menu_primary_font_size]', 'type' => 'text', 'description' => '

        '. esc_html__( 'Menu Primary Font Size. default value is 100( % ). set font size between 77 and 182', 'Raindrops' ). '

        ', ) ); //raindrops_plugin_presentation_the_events_calendar /* Label change 'Display Header Text' */ $wp_customize->add_control( 'display_header_text', array( 'settings' => 'header_textcolor', 'label' => __( 'Move Tagline Position from top right to header image', 'Raindrops' ), 'section' => 'title_tagline', 'type' => 'checkbox', ) ); do_action( 'raindrops_customize_register' ); } } add_filter( 'raindrops_prev_next_post', 'raindrops_remove_element' ); add_filter( 'raindrops_posted_on', 'raindrops_remove_element' ); add_filter( 'raindrops_posted_in', 'raindrops_remove_element' ); /** * * * * */ if ( !function_exists( 'raindrops_remove_element' ) ) { function raindrops_remove_element( $content ) { return preg_replace( '!]+><\/span>!', '', $content ); } } /** * * * * * thanks aison */ if ( !function_exists( 'raindrops_page_menu_args' ) ) { function raindrops_page_menu_args( $args ) { global $raindrops_nav_menu_home_link; $args[ 'show_home' ] = $raindrops_nav_menu_home_link; return $args; } } /** * * * * * @since 0.980 */ if ( !function_exists( 'insert_message_action_hook_position' ) ) { function insert_message_action_hook_position( $hook_name = '' ) { add_action( 'raindrops_after_nav_menu', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_entry_content', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_extra_sidebar', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_extra_sidebar', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_doc', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_doc', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_default_sidebar', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_default_sidebar', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_footer', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_footer', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_entry_content', 'raindrops_action_hook_messages' ); add_action( 'raindrops_prepend_loop', 'raindrops_action_hook_messages' ); add_action( 'raindrops_append_loop', 'raindrops_action_hook_messages' ); } } if ( true == WP_DEBUG && true == $raindrops_actions_hook_message ) { insert_message_action_hook_position(); } /** * * * * * @since 1.204 */ if ( !function_exists( 'raindrops_prepend_loop' ) ) { function raindrops_prepend_loop() { $args = array( 'hook_name' => 'raindrops_prepend_loop', 'template_part_name' => 'hook-prepend-loop.php' ); get_template_part( 'hook', 'prepend-loop' ); do_action( 'raindrops_prepend_loop', $args ); } } /** * * * * * @since 1.204 */ if ( !function_exists( 'raindrops_append_loop' ) ) { function raindrops_append_loop() { $args = array( 'hook_name' => 'raindrops_append_loop', 'template_part_name' => 'hook-append-loop.php' ); get_template_part( 'hook', 'append-loop' ); do_action( 'raindrops_append_loop', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_action_hook_messages' ) ) { function raindrops_action_hook_messages( $args ) { if ( isset( $args ) && array_key_exists( 'hook_name', $args ) && array_key_exists( 'template_part_name', $args ) ) { $message = esc_html__( 'add_action( \'%1$s\', \'your_function\' ) or add template part file the name \'%2$s\'.' ); $message = sprintf( $message, $args[ 'hook_name' ], $args[ 'template_part_name' ] ); printf( '
        %1$s
        ', $message, 'word-break:break-all;word-wrap:break-word;' ); } } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_after_nav_menu' ) ) { function raindrops_after_nav_menu() { get_template_part( 'hook', 'after-nav-menu' ); $args = array( 'hook_name' => 'raindrops_after_nav_menu', 'template_part_name' => 'hook-after-nav-menu.php' ); do_action( 'raindrops_after_nav_menu', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_prepend_doc' ) ) { function raindrops_prepend_doc() { $args = array( 'hook_name' => 'raindrops_prepend_doc', 'template_part_name' => 'hook-prepend-doc.php' ); get_template_part( 'hook', 'prepend-doc' ); do_action( 'raindrops_prepend_doc', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_append_doc' ) ) { function raindrops_append_doc() { $args = array( 'hook_name' => 'raindrops_append_doc', 'template_part_name' => 'hook-append-doc.php' ); get_template_part( 'hook', 'append-doc' ); do_action( 'raindrops_append_doc', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_prepend_entry_content' ) ) { function raindrops_prepend_entry_content() { $args = array( 'hook_name' => 'raindrops_prepend_entry_content', 'template_part_name' => 'hook-prepend-entry-content.php' ); get_template_part( 'hook', 'prepend-entry-content' ); do_action( 'raindrops_prepend_entry_content', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_prepend_extra_sidebar' ) ) { function raindrops_prepend_extra_sidebar() { $args = array( 'hook_name' => 'raindrops_prepend_extra_sidebar', 'template_part_name' => 'hook-prepend-extra-sidebar.php' ); get_template_part( 'hook', 'prepend-extra-sidebar' ); do_action( 'raindrops_prepend_extra_sidebar', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_prepend_default_sidebar' ) ) { function raindrops_prepend_default_sidebar() { $args = array( 'hook_name' => 'raindrops_prepend_default_sidebar', 'template_part_name' => 'hook-prepend-default-sidebar.php' ); get_template_part( 'hook', 'prepend-default-sidebar' ); do_action( 'raindrops_prepend_default_sidebar', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_prepend_footer' ) ) { function raindrops_prepend_footer() { $args = array( 'hook_name' => 'raindrops_prepend_footer', 'template_part_name' => 'hook-prepend-footer.php' ); get_template_part( 'hook', 'prepend-footer' ); do_action( 'raindrops_prepend_footer', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_append_entry_content' ) ) { function raindrops_append_entry_content() { $args = array( 'hook_name' => 'raindrops_append_entry_content', 'template_part_name' => 'hook-append-entry-content.php' ); get_template_part( 'hook', 'append-entry-content' ); do_action( 'raindrops_append_entry_content', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_append_extra_sidebar' ) ) { function raindrops_append_extra_sidebar() { $args = array( 'hook_name' => 'raindrops_append_extra_sidebar', 'template_part_name' => 'hook-append-extra-sidebar.php' ); get_template_part( 'hook', 'append-extra-sidebar' ); do_action( 'raindrops_append_extra_sidebar', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_append_default_sidebar' ) ) { function raindrops_append_default_sidebar() { $args = array( 'hook_name' => 'raindrops_append_default_sidebar', 'template_part_name' => 'hook-append-default-sidebar.php' ); get_template_part( 'hook', 'append-default-sidebar' ); do_action( 'raindrops_append_default_sidebar', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_append_footer' ) ) { function raindrops_append_footer() { $args = array( 'hook_name' => 'raindrops_append_footer', 'template_part_name' => 'hook-append-footer.php' ); get_template_part( 'hook', 'append-footer' ); do_action( 'raindrops_append_footer', $args ); } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_entry_title' ) ) { function raindrops_entry_title( $args = array() ) { global $post, $templates, $raindrops_link_unique_text; $default = array( 'raindrops_title_element' => 'h2', ); $args = wp_parse_args( $args, $default ); $thumbnail = ''; $raindrops_unique_label = ''; extract( $args, EXTR_SKIP ); if ( has_post_thumbnail( $post->ID ) && !is_singular() && !post_password_required() ) { $thumbnail .= "\n". str_repeat("\t", 11 ). ''; $thumbnail .= get_the_post_thumbnail( $post->ID, array( 48, 48 ), array( "style" => "vertical-align:middle;", "alt" => esc_attr__( 'Featured Image', 'Raindrops' ) ) ); $thumbnail .= "\n". str_repeat("\t", 11 ). ''; } if ( ! has_post_thumbnail( $post->ID ) && !is_singular() && !post_password_required() ) { $thumbnail = apply_filters('raindrops_title_thumbnail', $thumbnail ,'', ''); } if ( !is_singular() || is_page_template( 'page-templates/list-of-post.php' ) || ( is_page_template( 'page-templates/full-width.php' ) && is_front_page() ) || ( is_page_template( 'page-templates/front-page.php' ) && is_front_page() ) ) { $html = '<' . $raindrops_title_element . ' class="%1$s">%5$s'. "\n". str_repeat("\t", 11 ).'%6$s %4$s'. "\n". str_repeat("\t", 10 ). ''; $html = sprintf( $html, apply_filters('raindrops_entry_title_class', 'h2 entry-title'), get_permalink(), the_title_attribute( array( 'before' => '', 'after' => '', 'echo' => false ) ), the_title( '', '', false ), $thumbnail, $raindrops_unique_label ); echo apply_filters( 'raindrops_entry_title', $html ); } else { $html = '<' . $raindrops_title_element . ' class="%1$s">%4$s%3$s %2$s'; $html = sprintf( $html, apply_filters('raindrops_entry_title_class', 'h2 entry-title'), the_title( '', '', false ), $raindrops_unique_label, $thumbnail ); echo apply_filters( 'raindrops_entry_title', $html ); } } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_entry_content' ) ) { function raindrops_entry_content( $more_link_text = null, $stripteaser = false ) { global $post; if ( raindrops_detect_display_none_condition() && !is_sticky() ) { return; } $raindrops_excerpt_condition = raindrops_detect_excerpt_condition(); if ( true == $raindrops_excerpt_condition && !is_sticky() ) { /* remove shortcodes */ $excerpt = preg_replace( '!\[[^\]]+\]!', '', get_the_excerpt() ); $excerpt = apply_filters( 'the_excerpt', $excerpt ); echo apply_filters( 'raindrops_entry_content', $excerpt ); } else { if ( empty( $more_link_text ) ) { $more_link_text = esc_html__( 'Continue reading ', 'Raindrops' ) . '' . esc_html__( ' Post ID ', 'Raindrops' ) . get_the_ID() . ''; } $content = ''; // wp-includes/post-template.php:265 - Trying to get property of non-object if ( isset( $post ) ) { $content = get_the_content( $more_link_text, $stripteaser ); } $content = apply_filters( 'the_content', $content ); $content = apply_filters( 'raindrops_entry_content', $content ); $content = str_replace( ']]>', ']]>', $content ); echo $content; } } } /** * * * * * @since 0.980 */ if ( !function_exists( 'raindrops_next_prev_links' ) ) { function raindrops_next_prev_links( $position = 'nav-above' ) { global $wp_query, $paged; $raindrops_old = $paged + 1; $raindrops_new = $paged - 1; $raindrops_old = raindrops_link_unique( $text = 'Next Page', $raindrops_old ); $raindrops_new = raindrops_link_unique( $text = 'Next Page', $raindrops_new ); if ( $wp_query->max_num_pages > 1 ) { $html = '
        '."\n". str_repeat("\t", 8). '%1$s%2$s'."\n". str_repeat("\t", 7).'
        '. "\n"; $html = sprintf( $html, get_next_posts_link( '' . $raindrops_old . esc_html__( ' Older posts', 'Raindrops' ) ), get_previous_posts_link( '' . $raindrops_new . esc_html__( 'Newer posts', 'Raindrops' ) . '' ), $position ); echo apply_filters( 'raindrops_next_prev_links', $html, $position ); } } } if ( version_compare( $wp_version, '4.0.1', '>' ) ) { add_filter( 'raindrops_next_prev_links', 'raindrops_the_pagenation', 10, 2); } function raindrops_the_pagenation( $html , $position){ global $raindrops_document_type; if ( function_exists( 'get_the_posts_pagination' ) && $position == 'nav-below' ) { if ( $raindrops_document_type == 'html5' ) { return get_the_posts_pagination(); } elseif( $raindrops_document_type == 'xhtml' ) { $result = str_replace( array('

      ' . esc_html__( 'Page', 'Raindrops' ) . '2'; } else { $url = add_query_arg( 'page', 2 ) . '#portfolio'; $html = '
    • ' . esc_html__( 'Page', 'Raindrops' ) . '2
    • '; } } elseif ( $args[ 'paged' ] > 0 ) { $page = $args[ 'paged' ] + 1; $url = add_query_arg( 'page', $page ) . '#portfolio'; $html = sprintf( $raindrops_html_page, esc_url( $url ), 'portfolio-next portfolio-' . $page, 'portfolio-nav-next', esc_html__( 'Page', 'Raindrops' ) . ' ' . $page ); } $url = add_query_arg( 'page', $args[ 'paged' ] ) . '#portfolio'; $raindrops_page_for_posts = get_option( 'page_for_posts' ); $raindrops_html_page = '
    • %4$s
    • '; if ( $args['post_type'] == 'post' && $raindrops_page_for_posts ){ $html .= sprintf( $raindrops_html_page, esc_url( get_permalink( $raindrops_page_for_posts ) ), 'portfolio-link-to-page-for-posts', 'link-to-page-title', get_the_title( $raindrops_page_for_posts ) ); } if ( 2 == $args[ 'paged' ] ) { $page = $args[ 'paged' ] - 1; $url = add_query_arg( 'page', $page ) . '#portfolio'; $html .= sprintf( $raindrops_html_page, esc_url( $url ), 'portfolio-prev portfolio-home', 'portfolio-nav-prev', __( 'Portfolio Home', 'Raindrops' ) ); } elseif ( $args[ 'paged' ] > 2 ) { $page = $args[ 'paged' ]; $page = $page - 1; $url = add_query_arg( 'page', $page ) . '#portfolio'; $html .= sprintf( $raindrops_html_page, esc_url( $url ), 'portfolio-prev portfolio-' . $page, 'portfolio-nav-prev', esc_html__( 'Page', 'Raindrops' ) . ' ' . $page ); } echo apply_filters( 'raindrops_portfolio_nav', sprintf( '
        %1$s
      ', $html ) ); } else { //! empty( $raindrops_posts ) ?>
      < id="post-" >%4$s

      '; if ( preg_match( '!page=!', $query_string ) ) { ?>

      End

      >
      ' . $pre . '%3$s' . $after . ''; if ( empty( $more_link_text ) ) { $raindrops_aria_hidden = raindrops_doctype_elements( '', 'aria-hidden="true"', false ); $more_link_text = esc_html__( 'Continue reading ', 'Raindrops' ) . '' . esc_html__( ' Post ID ', 'Raindrops' ) . $id . ''; } $output = ''; $strip_teaser = false; $more = false; if ( preg_match( '//', $content, $matches ) ) { $fragment_identifier = ''; } else { $fragment_identifier = '#more-' . $id; } if ( preg_match( '//', $content, $matches ) ) { $content = explode( $matches[ 0 ], $content, 2 ); if ( !empty( $matches[ 1 ] ) ) { $more_link_text = esc_html( $matches[ 1 ] ); } if ( !empty( $matches[ 1 ] ) && !empty( $more_link_text ) ) { $more_link_text = strip_tags( wp_kses_no_null( trim( $matches[ 1 ] ) ) ); } $more = true; } if ( is_array( $content ) ) { $content = $content[ 0 ]; $content .= apply_filters( 'the_content_more_link', sprintf( $html, get_permalink( $id ), $fragment_identifier, $more_link_text ), $more_link_text ); $content = force_balance_tags( $content ); return apply_filters( 'raindrops_add_more', $content, $more ); } else { return apply_filters( 'raindrops_add_more', $content, $more ); } } } /** * * * * @since 1.211 */ if ( !function_exists( 'raindrops_status_bar' ) ) { function raindrops_status_bar() { global $raindrops_status_bar, $post; if ( $raindrops_status_bar !== true ) { return; } ?>
      top

      '; echo apply_filters( 'raindrops_status_bar_top', $link_to_top ); if ( 'posts' == get_option( 'show_on_front' ) ) { raindrops_monthly_archive_prev_next_navigation(); } ?>
      'page', 'post_status' => 'publish', 'numberposts' => -1, 'order' => 'ASC', 'orderby' => 'post_title', 'post_parent' => $post->ID, ); $html = '%2$s'; $child_pages = query_posts( $args ); if ( !empty( $child_pages ) && is_array( $child_pages ) ) { $number = count( $child_pages ); ?> ID ) ); $title = apply_filters( 'the_title', $child->post_title ); printf( $html, $permalink, $title ); if ( end( $child_pages ) !== $child ) { echo ' , '; } } } wp_reset_query(); ?>
      Skip to %3$s'; if ( $raindrops_theme_settings !== 'no' ) { if ( isset( $raindrops_theme_settings[ 'widget_ids' ] ) ) { $copy = $raindrops_theme_settings[ 'widget_ids' ]; if ( $rsidebar_show == false ) { unset( $copy[ 'sidebar-2' ] ); } if ( is_singular() ) { return; } foreach ( $copy as $key => $array_val ) { if (isset( $array_val ) && is_array( $array_val ) ) { foreach ( $array_val as $val ) { $result .= sprintf( $html, wp_kses( $val, array() ), esc_attr( $val ), esc_html( strtoupper( $val ) ) ); } } } return $result; } } else { $raindrops_id_bases = array( 'WP_Widget_Categories' => 'categories', 'WP_Widget_Archives' => 'archives', 'WP_Widget_Calendar' => 'calendar', 'WP_Widget_Pages' => 'pages', 'WP_Widget_Recent_Comments' => 'recent-comments', 'WP_Widget_RSS' => 'rss', 'WP_Widget_Text' => 'text', 'WP_Widget_Tag_Cloud' => 'tag_cloud', 'WP_Nav_Menu_Widget' => 'nav_menu', 'WP_Widget_Search' => 'search' ); foreach ( $raindrops_id_bases as $key => $val ) { if ( is_active_widget( '', '', $val ) ) { $result .= sprintf( $html, wp_kses( $wp_widget_factory->widgets[ $key ]->id, array() ), esc_attr( $wp_widget_factory->widgets[ $key ]->name ), esc_html( $wp_widget_factory->widgets[ $key ]->name ) ); } } return $result; } } } /** * Filter of paragraph correction * * * @param type $content * @return type * @sincd 1.231 */ if ( !function_exists( 'raindrops_remove_wrong_p_before' ) ) { function raindrops_remove_wrong_p_before( $content ) { return str_replace( array( '
      ', '
      ' ), array( "
      \n\n", "\n
      " ), $content ); } } if ( !function_exists( 'raindrops_remove_wrong_p' ) ) { function raindrops_remove_wrong_p( $content ) { $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|h[1-6]|hr|fieldset|noscript|legend|section|article|aside|hgroup|header|footer|nav|figure|details|menu|summary)'; /* 1.261 remove p at allblocks */ $content = preg_replace( '!([^(

      )]*)

      ()!', "$1$2", $content ); $content = preg_replace( '!(<(select|del|option|canvas|mrow|svg|rect|optgroup) [^>]*>)(
      |

      )!', "$1", $content ); $content = preg_replace( '!(|||||||||||||)
      !', "$1", $content ); $content = preg_replace( '!

      \s*(]*>)\s*

      !', "$1", $content ); $content = preg_replace( '!(]*>)\s*

      !', "$1", $content ); $content = preg_replace( '!(

      )(]*>)!', "$2", $content ); $content = preg_replace( '!(

      [^<]*)()!', "$1

      $2", $content ); $content = preg_replace( '!(<' . $allblocks . '[^>]*>[^<]*)

      !', "$1", $content ); $content = preg_replace( '!(<' . $allblocks . '[^>]*>)([^(<|\s)]+)

      !', "$1

      $2

      ", $content ); return $content; } } /** * * * @since 1.234 */ if ( !function_exists( 'raindrops_call_custom_css' ) ) { function raindrops_call_custom_css() { new raindrops_custom_css(); } } /** * * * Raindrops indivisual CSS */ if ( !class_exists( 'raindrops_custom_css' ) ) { class raindrops_custom_css { public function __construct() { add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) ); add_action( 'save_post', array( $this, 'save' ) ); } public function add_meta_box( $post_type ) { $post_types = array( 'post', 'page' ); if ( in_array( $post_type, $post_types ) ) { add_meta_box( 'raindrops_custom_css' , __( 'Custom CSS for this entry', 'raindrops' ) , array( $this, 'render_meta_box_content' ) , $post_type , 'advanced' , 'high' ); } } public function save( $post_id ) { if ( !isset( $_POST[ 'raindrops_inner_custom_box_nonce' ] ) ) { return $post_id; } $nonce = $_POST[ 'raindrops_inner_custom_box_nonce' ]; if ( !wp_verify_nonce( $nonce, 'raindrops_inner_custom_box' ) ) { return $post_id; } if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return $post_id; } if ( 'page' == $_POST[ 'post_type' ] ) { if ( !current_user_can( 'edit_page', $post_id ) ) return $post_id; } else { if ( !current_user_can( 'edit_post', $post_id ) ) return $post_id; } $data = sanitize_text_field( $_POST[ 'raindrops_custom_css_field' ] ); $data = str_replace( array( "\n", "\r" ), '', $data ); update_post_meta( $post_id, '_css', $data ); if ( isset( $_POST[ 'add-to-front' ] ) && !empty( $_POST[ 'add-to-front' ] ) ) { $data = sanitize_text_field( $_POST[ 'add-to-front' ] ); update_post_meta( $post_id, '_add-to-front', $data ); } if ( isset( $_POST[ 'header-image-show' ] ) && !empty( $_POST[ 'header-image-show' ] ) ) { $data = sanitize_text_field( $_POST[ 'header-image-show' ] ); update_post_meta( $post_id, '_raindrops_header_image_show', $data ); } if ( isset( $_POST[ 'header-image-file' ] ) && !empty( $_POST[ 'header-image-file' ] ) ) { $data = sanitize_text_field( $_POST[ 'header-image-file' ] ); update_post_meta( $post_id, '_raindrops_this_header_image', $data ); } } public function render_meta_box_content( $post ) { do_action( ' raindrops_custom_css_pre' ); $form = ''; wp_nonce_field( 'raindrops_inner_custom_box', 'raindrops_inner_custom_box_nonce' ); $value = get_post_meta( $post->ID, '_css', true ); $value = str_replace( array( '{', '}', ), array( "{\n", "\n}\n", ), $value ); $value = str_replace( '![^(\"|\')];!', ";\n", $value ); $raindrops_restore_check = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) ); $current_value = get_post_meta( $post->ID, '_raindrops_this_header_image', true ); $form .= '' . ''; $form .= ''; $raindrops_static_front_page_id = get_option( 'page_on_front' ); $raindrops_static_front_page_template_slug = basename( get_page_template_slug( $raindrops_static_front_page_id ) ); $raindrops_current_screen = get_current_screen(); $current_value = get_post_meta( $post->ID, '_add-to-front', true ); if ( $raindrops_static_front_page_template_slug == 'front-page.php' && $raindrops_current_screen->post_type == 'page' ) { $form .= '

      ' . esc_html__( 'Add Front Page', 'Raindrops' ) . '

      '; $form .= '

      ' . __( 'Add Front Page This Content', 'Raindrops' ) . '

      '; $form .= '

      ' . __( 'No Need', 'Raindrops' ) . '

      '; } if ( 'remove-header' !== $raindrops_restore_check ) { $form .= '

      ' . esc_html__( 'Override header Image', 'Raindrops' ) . '

      '; $images = get_uploaded_header_images(); $form .= '

      ' . __( 'Hide Header Image', 'Raindrops' ) . '

      '; $form .= '

      ' . __( 'Default Image', 'Raindrops' ) . '

      '; $form .= '
      '; $header_image_html = '

      ' . '' . '' . '

      '; foreach ( $images as $image ) { $form .= sprintf( $header_image_html, 'style="display:inline-block;"', 'style="position:relative;top:-1em;"', $image[ 'attachment_id' ], checked( $image[ 'attachment_id' ], $current_value, false ), $image[ 'url' ] ); } $form .= '
      '; $form .= '

      ' . esc_html__( 'Add Custom Header', 'Raindrops' ) . '

      '; } printf( $form, 'raindrops_custom_css_field', __( 'The Custom CSS Field only for the current post', 'Raindrops' ), esc_textarea( $value ), 'style="width:100%;height:13em;font-size:1.3em;"' ); do_action( ' raindrops_custom_css_after' ); } } } /** * * @param type $out * @param type $pairs * @param type $atts * @return string */ add_filter( 'shortcode_atts_playlist', 'raindrops_play_list_add_atts', 10, 3 ); if ( !function_exists( 'raindrops_play_list_add_atts' ) ) { function raindrops_play_list_add_atts( $out, $pairs, $atts ) { global $post; if ( !is_singular() ) { $color_type = raindrops_warehouse_clone( 'raindrops_style_type' ); if ( 'dark' == $color_type ) { $out[ 'style' ] = 'dark'; } } else { $raindrops_content_check = get_post( $post->ID ); $raindrops_content_check = $raindrops_content_check->post_content; if ( preg_match( "!\[raindrops[^\]]+(color_type)=(\"|')*?([^\"' ]+)(\"|' )*?[^\]]*\]!si", $raindrops_content_check, $regs ) ) { if ( 'dark' == trim( $regs[ 2 ] ) ) { $out[ 'style' ] = 'dark'; } } else { $color_type = raindrops_warehouse_clone( 'raindrops_style_type' ); if ( 'dark' == $color_type ) { $out[ 'style' ] = 'dark'; } } } return $out; } } if ( !function_exists( 'raindrops_complementary_color' ) ) { function raindrops_complementary_color( $hex_color = '#444' ) { $rgb_array = raindrops_hex2rgb_array_clone( $hex_color ); if ( false !== $rgb_array ) { $rgb_max_value = max( $rgb_array ); $rgb_min_value = min( $rgb_array ); $rgb_total = $rgb_max_value + $rgb_min_value; $r_value = sprintf( '%02s', dechex( $rgb_total - $rgb_array[ 0 ] ) ); $g_value = sprintf( '%02s', dechex( $rgb_total - $rgb_array[ 1 ] ) ); $b_value = sprintf( '%02s', dechex( $rgb_total - $rgb_array[ 2 ] ) ); return '#' . $r_value . $g_value . $b_value; } return false; } } add_action( 'wp_enqueue_scripts', 'raindrops_add_complementary_color' ); if ( !function_exists( 'raindrops_add_complementary_color' ) ) { function raindrops_add_complementary_color() { if ( 'yes' == raindrops_warehouse_clone( 'raindrops_complementary_color_for_title_link' ) ) { $raindrops_link_color = raindrops_warehouse_clone( 'raindrops_hyperlink_color' ); $raindrops_complementary_color = raindrops_complementary_color( $raindrops_link_color ); $raindrops_css = sprintf( '.entry-title span{color:%1$s;}', $raindrops_complementary_color ); $raindrops_css = apply_filters( 'raindrops_add_complementary_color', $raindrops_css, $raindrops_link_color, $raindrops_complementary_color ); wp_add_inline_style( 'style', $raindrops_css ); } } } if ( !function_exists( 'raindrops_oembed_filter' ) ) { /** * * @param type $html * @param type $url * @param type $attr * @param type $post_ID * @return type string html * @since 1.246 */ function raindrops_oembed_filter( $html, $url, $attr, $post_ID ) { global $is_IE; if ( ! $is_IE ) { $html = str_replace( 'frameborder="0"', '', $html ); } $element = raindrops_doctype_elements( 'div', 'figure', false ); if ( !preg_match( '!twitter.com!', $url ) ) { return sprintf( '<%2$s class="oembed-container clearfix">%1$s', $html, $element ); } return $html; } } /** * Change color type styles from embed head element to external link * * @since 1.254 */ global $wp_customize; //$raindrops_new_style_load //&& $raindrops_new_style_load == true if ( ! isset( $wp_customize ) ) { /** * @1.254 */ add_action( 'after_setup_theme', 'raindrops_setup_style_loader' ); } if ( !function_exists( 'raindrops_setup_style_loader' ) ) { /** * * @1.254 */ function raindrops_setup_style_loader(){ //@ see line:501 query var add_action( 'wp_enqueue_scripts', 'raindrops_register_color_type_style' ,99 ); add_action( 'template_redirect', 'raindrops_color_type_style_buffer'); } } if ( !function_exists( 'raindrops_register_color_type_style' ) ) { /** * * @global type $raindrops_current_data_version * @1.254 */ function raindrops_register_color_type_style() { global $raindrops_current_data_version,$post,$posts; $query = ''; $count = count( $posts ); if( isset($post) && $count == 1 ) { $query = sprintf( '&p=%1$s', $post->ID); } $version = md5( raindrops_embed_css() ); wp_register_style( 'raindrops_color_type', sprintf('/?%1$s=1%2$s', 'raindrops_color_type', $query ),array(), $version ); wp_enqueue_style( 'raindrops_color_type' ); } } if ( !function_exists( 'raindrops_color_type_style_buffer' ) ) { /** * * @1.254 */ function raindrops_color_type_style_buffer( ) { global $raindrops_fallback_human_interface_show,$post; if( intval( get_query_var( 'raindrops_color_type' ) ) == 1 ) { if( $raindrops_fallback_human_interface_show == true ) { exit;} $style = apply_filters('raindrops_color_type_style_buffer',raindrops_embed_css()); if( ! defined( 'WP_DEBUG') || WP_DEBUG == false ) { $style = preg_replace('!('. wp_spaces_regexp() .'){2,}!', ' ', $style ); } ob_start(); header( 'Content-type: text/css' ); $css = $style; $css = wp_kses( $css, array() ); $css = str_replace( array(">",'raindrops_color_ja'),array('>',''),$css); echo $css; exit; ob_clean(); } } } if ( !function_exists( 'raindrops_unique_entry_title' ) ) { function raindrops_unique_entry_title( $postid = '', $echo = false ) { global $post; if ( isset( $post ) && empty( $postid ) ) { $postid = $post->ID; } elseif ( empty( $post ) ) { return; } $post_object = get_post( $postid ); $post_name = $post_object->post_name; $unique_title = urldecode( wp_unique_post_slug( $post_name, $post->ID, 'publish', 'post', 0 ) ); preg_match( '!(.+)(-[0-9]+)$!', $unique_title, $regs ); if ( isset( $regs[ 2 ] ) ) { if ( true == $echo ) { echo esc_html( $regs[ 2 ] ); } else { return esc_html( $regs[ 2 ] ); } } } } if ( ! function_exists( 'raindrops_footer_text' ) ) { function raindrops_footer_text() { global $raindrops_current_theme_name, $raindrops_current_data_theme_uri, $template, $raindrops_accessibility_link; $raindrops_address_html = '
      '; $raindrops_address_html .= apply_filters( 'raindrops_prepend_footer_address', '' ); $raindrops_address_rss = "\n". str_repeat("\t", 2 ). '&copy;%1$s %2$s %4$s' . "\n". str_repeat("\t", 3 ). ''. esc_html__( 'and', 'Raindrops' ) . '' . "\n". str_repeat("\t", 2 ). '%6$s'; $raindrops_address_html .= sprintf( $raindrops_address_rss, date( "Y" ), $raindrops_current_theme_name, get_bloginfo( 'rss2_url' ), esc_html__( "Entries RSS", "Raindrops" ), get_bloginfo( 'comments_rss2_url' ), esc_html__( 'Comments RSS', "Raindrops" ) ); $raindrops_address_html .= ' '; if ( is_child_theme() ) { $raindrops_theme_name = 'Child theme ' . esc_html( ucwords( $raindrops_current_theme_name ) ) . ' of ' . esc_html__( "Raindrops Theme", "Raindrops" ); } else { $raindrops_theme_name = esc_html__( "Raindrops Theme", "Raindrops" ); } $raindrops_address_html .= sprintf( "\n". str_repeat("\t", 2 ). '%s ', $raindrops_current_data_theme_uri, $raindrops_theme_name ); $raindrops_address_html .= apply_filters( 'raindrops_append_footer_address', '' ); $raindrops_address_html .= "\n". str_repeat("\t", 1 ). '
      '; echo apply_filters( 'raindrops_footer_text', $raindrops_address_html ); } } if ( ! function_exists( 'raindrops_wp_headers' ) ) { function raindrops_wp_headers($headers, $this ) { global $raindrops_xhtml_media_type; if( !is_admin() && !is_user_logged_in() && 'xhtml' == raindrops_warehouse_clone( 'raindrops_doc_type_settings' ) && $raindrops_xhtml_media_type == 'application/xhtml+xml' ) { $headers["Content-Type"] = $raindrops_xhtml_media_type. '; charset='. get_bloginfo( 'charset' ); add_filter( 'option_html_type', 'raindrops_xhtml_media_type', 10 ); } return $headers; } } if ( ! function_exists( 'raindrops_xhtml_media_type' ) ) { function raindrops_xhtml_media_type( $type ) { global $raindrops_xhtml_media_type; if( !is_admin() && !is_user_logged_in() && 'xhtml' == raindrops_warehouse_clone( 'raindrops_doc_type_settings' ) && $raindrops_xhtml_media_type == 'application/xhtml+xml' ) { return $raindrops_xhtml_media_type; } return $type; } } if ( ! function_exists( 'raindrops_xhtml_http_equiv' ) ) { function raindrops_xhtml_http_equiv( $output = true ) { global $raindrops_xhtml_media_type; if( $raindrops_xhtml_media_type == 'text/html' && 'xhtml' == raindrops_warehouse_clone( 'raindrops_doc_type_settings' ) ) { /** * By already header (), htmltype and charset has been sent */ // printf( ''. "\n" ); printf( ''. "\n" ); printf( ''. "\n" ); } } } add_action( 'save_post', 'raindrops_register_webfonts', 10, 3 ); if ( !function_exists( 'raindrops_register_webfonts' ) ) { /** * * @param type $post_ID * @param type $post * @param type $update * @return boolean * @1.264 */ function raindrops_register_webfonts( $post_ID, $post, $update ) { if ( !current_user_can('edit_posts') ) { return false; } $early_access = array('alefhebrew' , 'amiri' , 'dhurjati' , 'dhyana' , 'droidarabickufi' , 'droidarabicnaskh' , 'droidsansethiopic' , 'droidsanstamil' , 'droidsansthai' , 'droidserifthai' , 'gidugu' , 'gurajada' , 'hanna' , 'jejugothic' , 'jejuhallasan' , 'jejumyeongjo' , 'karlatamilinclined' , 'karlatamilupright' , 'kopubbatang' , 'lakkireddy' , 'laomuangdon' , 'laomuangkhong' , 'laosanspro' , 'lateef' , 'lohitbengali' , 'lohitdevanagari' , 'lohittamil' , 'mallanna' , 'mandali' , 'myanmarsanspro' , 'nats' , 'ntr' , 'nanumbrushscript' , 'nanumgothic' , 'nanumgothiccoding' , 'nanummyeongjo' , 'nanumpenscript' , 'notokufiarabic' , 'notonaskharabic' , 'notonastaliqurdudraft' , 'notosansarmenian' , 'notosansbengali' , 'notosanscherokee' , 'notosansdevanagari' , 'notosansdevanagariui' , 'notosansethiopic' , 'notosansgeorgian' , 'notosansgujarati' , 'notosansgurmukhi' , 'notosanshebrew' , 'notosansjapanese' , 'notosanskannada' , 'notosanskhmer' , 'notosanskufiarabic' , 'notosanslao' , 'notosanslaoui' , 'notosansmalayalam' , 'notosansmyanmar' , 'notosansosmanya' , 'notosanssinhala' , 'notosanstamil' , 'notosanstamilui' , 'notosanstelugu' , 'notosansthai' , 'notosansthaiui' , 'notoserifarmenian' , 'notoserifgeorgian' , 'notoserifkhmer' , 'notoseriflao' , 'notoserifthai' , 'opensanshebrew' , 'opensanshebrewcondensed' , 'padauk' , 'peddana' , 'phetsarath' , 'ponnala' , 'ramabhadra' , 'raviprakash' , 'scheherazade' , 'souliyo' , 'sreekrushnadevaraya' , 'suranna' , 'suravaram' , 'tenaliramakrishna' , 'thabit' , 'tharlon' , 'cwtexfangsong' , 'cwtexhei' , 'cwtexkai' , 'cwtexming' ); $flag_early_access = false; $include_fonts = ''; $link_html = '' . "\n"; $url = apply_filters( 'google_fonts_endpoint_url', '//fonts.googleapis.com/css' ); $secondary = ''; $separator = ''; $mid_name = ''; $has_mid_name = array(); $web_font_styles = ''; $font_for_style_italic = ''; $font_for_style_weight = ''; if ( preg_match_all( '!class="([^\"]*)(google-font-)([a-z0-9-]+)([^\"]*)"!', $post->post_title . $post->post_content, $regs, PREG_SET_ORDER ) ) { if ( isset( $regs) && !empty( $regs ) ) { foreach ( $regs as $reg ) { if ( strstr( $reg[ 3 ], '-' ) ) { if( count( $has_mid_name = explode( '-', $reg[ 3 ] ) ) == 3 ) { list( $primary, $mid_name, $secondary ) = $has_mid_name; } else { list( $primary, $secondary) = explode( '-', $reg[ 3 ] ); } } else { $primary = $reg[ 3 ]; } preg_match_all( '!([0-9]00)(i)?!', $reg[ 3 ], $weight_and_italic ); if ( is_array( $weight_and_italic ) ) { $weight_and_italic_values = implode( ',', $weight_and_italic[ 0 ] ); $weight_and_italic_values = str_replace( 'i', 'italic', $weight_and_italic_values ); if ( !empty( $weight_and_italic_values ) ) { $separator = ':'; } } $primary = preg_replace( '![0-9]00(i)?!', '', $primary ); $secondary = preg_replace( '![0-9]00(i)?!', '', $secondary ); $mid_name = preg_replace( '![0-9]00(i)?!', '', $mid_name ); if( true == array_search( $primary. $mid_name. $secondary , $early_access ) ) { $flag_early_access = true; } if( ! empty($has_mid_name) ) { $font_name = ucfirst( $primary ) . ' ' . ucfirst( $mid_name ) . ' ' . ucfirst( $secondary ) . $separator . $weight_and_italic_values; $font_for_style = ucfirst( $primary ) . ' ' . ucfirst( $mid_name ). ' ' . ucfirst( $secondary );; } elseif ( !empty( $secondary ) && empty( $has_mid_name ) ) { $font_name = ucfirst( $primary ) . ' ' . ucfirst( $secondary ) . $separator . $weight_and_italic_values; $font_for_style = ucfirst( $primary ) . ' ' . ucfirst( $secondary ); } else { $font_name = ucfirst( $primary ); $font_for_style = ucfirst( $primary ); } if ( isset( $reg[ 3 ] ) ) { if ( strstr( $weight_and_italic_values, ',' ) ) { } else { if( ! empty( $weight_and_italic_values ) ) { if ( strstr( $weight_and_italic_values, 'italic' ) ) { $font_for_style_italic = 'font-style: italic;'; } if ( preg_match('!([0-9]00)(i)?!', $weight_and_italic_values, $font_weight_value ) ) { $font_for_style_weight = 'font-weight: '. absint( $font_weight_value[1] ).';'; } } } $web_font_styles = str_replace('.mce-content-body .google-font-' . sanitize_html_class( $reg[ 3 ] ) . ', .hfeed .google-font-' . sanitize_html_class( $reg[ 3 ] ) . '{ font-family:"' . $font_for_style . '", sans-serif;'. $font_for_style_italic. $font_for_style_weight. '}' . "\n",'',$web_font_styles ); $web_font_styles .= '.mce-content-body .google-font-' . sanitize_html_class( $reg[ 3 ] ) . ', .hfeed .google-font-' . sanitize_html_class( $reg[ 3 ] ) . '{ font-family:"' . $font_for_style . '", sans-serif;'. $font_for_style_italic. $font_for_style_weight. '}' . "\n"; } $query_val = str_replace( '%2B', '+', urlencode( $font_name ) ); if ( preg_match( '!(font-effect-)([a-z-)]+)!', $reg[ 0 ], $effect ) ) { $font_url = add_query_arg( array( 'family' => $query_val, 'effect' => urlencode( $effect[ 2 ] ) ), $url ); } else { $font_url = add_query_arg( 'family', $query_val, $url ); } $font_url = str_replace( '&', '&', $font_url ); $id = $reg[ 3 ]; if( ! empty( $effect[ 2 ] )) { $id = $id. '-'. $effect[ 2 ]; } if( true == $flag_early_access ) { $font_url = 'http://fonts.googleapis.com/earlyaccess/'; $font_url .= str_replace( ' ','', strtolower( $font_name.'.css' ) ); $include_fonts = str_replace( sprintf( $link_html, $font_url ,'google-font-early-'. sanitize_html_class( $id ). '-css' ),'', $include_fonts ); $include_fonts .= sprintf( $link_html, $font_url ,'google-font-early-'. sanitize_html_class( $id ). '-css' ); } else { $include_fonts = str_replace( sprintf( $link_html, $font_url ,'google-font-'. sanitize_html_class( $id ). '-css' ) ,'', $include_fonts ); $include_fonts .= sprintf( $link_html, $font_url ,'google-font-'. sanitize_html_class( $id ). '-css' ); } unset( $regs ); $primary = ''; $secondary = ''; $separator = ''; $weight_and_italic_values = ''; $font_name = ''; $font_url = ''; $font_for_style_italic = ''; $font_for_style_weight = ''; $mid_name = ''; $has_mid_name = array(); $flag_early_access = false; } update_post_meta( $post_ID, '_web_fonts_link_element', $include_fonts ); update_post_meta( $post_ID, '_web_fonts_styles', $web_font_styles ); $already_included = get_post_meta( $post_ID ); if ( empty( $already_included ) ) { delete_post_meta( $post_ID, '_web_fonts_link_element' ); } } } } } if ( !function_exists( 'raindrops_tiny_mce_before_init' ) ) { /** * * @param array $init_array * @return string * @since 1.264 */ function raindrops_tiny_mce_before_init( $init_array ) { $separator = ''; if ( !empty( $init_array ) ) { $separator = ','; } $init_array[ 'content_css' ] = trim( $init_array[ 'content_css' ], ',' ) . $separator . raindrops_google_fonts_for_tinymce(); return $init_array; } } /** * * @since1.264 */ add_filter( 'tiny_mce_before_init', 'raindrops_tiny_mce_before_init' ); if ( !function_exists( 'raindrops_google_fonts_for_tinymce' ) ) { /** * * @global type $post * @return type * @since 1.264 */ function raindrops_google_fonts_for_tinymce() { if ( raindrops_warehouse_clone( 'raindrops_sync_style_for_tinymce' ) !== 'yes' ) { return; } global $post; $google_font_link_elements = get_post_meta( $post->ID, '_web_fonts_link_element', true ); $comma_separated_urls = ''; if ( preg_match_all( '!href="([^"]+)"!', $google_font_link_elements, $regs, PREG_SET_ORDER ) ) { foreach ( $regs as $reg ) { $comma_separated_urls .= ', ' . $reg[ 1 ]; } } return trim( $comma_separated_urls, ',' ); } } /** * * @since 1.264 */ add_action( 'wp_ajax_raindrops_editor_styles', 'raindrops_editor_styles_callback' ); add_action( 'wp_ajax_nopriv_raindrops_editor_styles', 'raindrops_editor_styles_callback' ); if ( !function_exists( 'raindrops_editor_styles_callback' ) ) { /** * * @global type $content_width * @return type * @since 1.264 */ function raindrops_editor_styles_callback() { global $content_width; if ( raindrops_warehouse_clone( 'raindrops_sync_style_for_tinymce' ) !== 'yes' ) { return; } $metabox_style = ''; $result = ''; if ( isset( $_REQUEST[ 'id' ] ) && !empty( $_REQUEST[ 'id' ] ) ) { $post_id = absint( $_REQUEST[ 'id' ] ); $metabox_style = get_post_meta( $post_id, '_css', true ); //$metabox_style = preg_replace_callback( '![^}]+{[^}]+}!siu', 'raindrops_css_add_id', $metabox_style ); //$metabox_style = str_replace( '#post-','#post-'. $post_id, $metabox_style ); $style = get_post_meta( $post_id, '_web_fonts_styles', true ); $result = str_replace( $style, '', $result ); $result .= $result . $style; } $defined_colors = raindrops_embed_css(); $defined_colors = str_replace( array( 'body', '.entry-content' ), array( 'no-body', 'html .mceContentBody' ), $defined_colors ); $font_size = raindrops_warehouse_clone( 'raindrops_basefont_settings' ); $font_color = raindrops_warehouse_clone( 'raindrops_default_fonts_color' ); $link_color = raindrops_warehouse_clone( 'raindrops_hyperlink_color' ); $editor_custom_styles = 'html .mceContentBody{max-width:' . $content_width . 'px;}' . "\n"; $editor_custom_styles .= 'html .mceContentBody{font-size:' . $font_size . 'px;}' . "\n"; if( isset( $font_color ) && !empty( $font_color )) { $editor_custom_styles .= 'html .mceContentBody.mce-content-body{color:' . $font_color . ';}' . "\n"; } if( isset( $link_color ) && !empty( $link_color )) { $editor_custom_styles .= 'html .mceContentBody a{color:' . $link_color . ';}' . "\n"; } header( 'Content-type: text/css' ); echo $editor_custom_styles; echo apply_filters( 'raindrops_editor_styles_callback', $result ); echo $defined_colors; echo $metabox_style; die(); } } if ( !function_exists( 'raindrops_get_pinup_widget_ids' ) ) { /** * * @return type array * @since 1.265 */ function raindrops_get_pinup_widget_ids() { $widgets = wp_get_sidebars_widgets(); $ids = array(); foreach ( $widgets as $key => $val_array ) { if ( preg_match( '$sidebar$', $key ) ) { foreach ( $val_array as $widget ) { if ( preg_match( '$raindrops_pinup_entry_widget-([0-9]+)$', $widget, $regs ) ) { $ids[] = absint( $regs[ 1 ] ); } } } } return $ids; } } if ( !function_exists( 'raindrops_apply_pinup_styles' ) ) { /** * * @return type string styles * @since 1.265 */ function raindrops_apply_pinup_styles() { $widget_ids = raindrops_get_pinup_widget_ids(); $style = ''; foreach ( $widget_ids as $id ) { $style .= raindrops_pinup_parse_styles( $id ); } return $style; } } if ( !function_exists( 'raindrops_pinup_widget_ids_to_post_ids' ) ) { /** * * @param type $ids * @return boolean * @since 1.265 */ function raindrops_pinup_widget_ids_to_post_ids( $ids ){ $widget_array = get_option( 'widget_raindrops_pinup_entry_widget' ); $raindrops_pinup_post_id = array(); if( is_array( $ids ) ) { foreach( $ids as $id ) { $raindrops_pinup_post_id[] = $widget_array[ $id ][ "id" ]; } return $raindrops_pinup_post_id; } return false; } } //var_dump( raindrops_get_pinup_widget_ids() ); if ( !function_exists( 'raindrops_pinup_parse_styles' ) ) { /** * * @param type $id * @return string * @since 1.265 */ function raindrops_pinup_parse_styles( $id ) { $id_prefix = 'pinup-'; $widget_array = get_option( 'widget_raindrops_pinup_entry_widget' ); $styles = $widget_array[ $id ][ "inline_style" ]; $raindrops_pinup_post_id = $widget_array[ $id ][ "id" ]; if ( empty( $styles ) ) { return ''; } if ( preg_match( '${$', $styles ) ) { preg_match_all( '$[^}]*{([^}]*)}$', $styles, $regs, PREG_SET_ORDER ); $result = ''; foreach ( $regs as $each_style ) { $result .= '#' . $id_prefix . $raindrops_pinup_post_id . ' ' . $each_style[ 0 ]; } } else { $result = '#' . $id_prefix . $raindrops_pinup_post_id . '{ ' . $styles . ' }'; } return $result; } } /** * * @since 1.265 */ add_filter( 'raindrops_color_type_style_buffer', 'raindrops_pinup_entry_style' ); global $wp_customize; if( isset( $wp_customize ) ) { add_filter( 'raindrops_embed_meta_css', 'raindrops_pinup_entry_style' ); } if ( !function_exists( 'raindrops_pinup_entry_style' ) ) { /** * * @param type $css * @return type string styel filterd value * @since 1.265 */ function raindrops_pinup_entry_style( $css ) { return $css . raindrops_apply_pinup_styles(); } } if ( ! function_exists( '_wp_render_title_tag' ) ) { /** * WordPress4.1 Backwards compatibility * @since 1.265 */ function raindrops_render_title() { ?><?php wp_title( '|', true, 'right' ); ?>