function wpgrade_callback_inlined_custom_style() { ob_start(); include wpgrade::corepartial('inline-custom-css' . EXT); $custom_css = ob_get_clean(); $style = 'wpgrade-main-style'; wp_add_inline_style($style, $custom_css); }
function wpgrade_write_custom_css($options) { if (wpgrade::option('inject_custom_css') !== 'file') { return; } $error = false; global $wp_filesystem; // Initialise the Wordpress filesystem, no more using file_put_contents function if (empty($wp_filesystem)) { require_once ABSPATH . '/wp-admin/includes/file.php'; WP_Filesystem(); } $css_dir = get_template_directory() . '/assets/css/'; ob_start(); include wpgrade::corepartial('inline-custom-css' . EXT); $css = ob_get_clean(); $wp_filesystem->put_contents($css_dir . 'custom.css', $css, FS_CHMOD_FILE); if ($error == true) { echo 'There is been an error around'; } }
/** * Invoked by wpgrade_callback_themesetup * The function is executed on the_content_more_link * * @param string content * * @return string */ function wpgrade_callback_cleanup_readmore_content($more_link, $more_link_text) { global $post; return include wpgrade::corepartial('read-more-content' . EXT); }
/** * The notifier page */ function update_notifier() { include wpgrade::corepartial('update-notifier' . EXT); }
/** * ... */ function wpgrade_callbacks_html5_shim() { global $is_IE; if ($is_IE) { include wpgrade::corepartial('ie-shim' . EXT); } }
/** * ... */ static function video_selfhosted($postID) { $video_m4v = get_post_meta($postID, wpgrade::prefix() . 'video_m4v', true); $video_webm = get_post_meta($postID, wpgrade::prefix() . 'video_webm', true); $video_ogv = get_post_meta($postID, wpgrade::prefix() . 'video_ogv', true); $video_poster = get_post_meta($postID, wpgrade::prefix() . 'video_poster', true); include wpgrade::corepartial('video-selfhosted' . EXT); }