PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 7.2.2
Jetpack – WP Security, Backup, Speed, & Growth v7.2.2
16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 All 502 releases
jetpack / modules / theme-tools / site-logo.php

site-logo.php in Jetpack – WP Security, Backup, Speed, & Growth 7.2.2, at modules/theme-tools/site-logo.php

47 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Site Logo.
4 * @see http://jetpack.com/support/site-logo/
5 *
6 * This feature will only be activated for themes that declare their support.
7 * This can be done by adding code similar to the following during the
8 * 'after_setup_theme' action:
9 *
10 * $args = array(
11 * 'header-text' => array(
12 * 'site-title',
13 * 'site-description',
14 * ),
15 * 'size' => 'medium',
16 * );
17 * add_theme_support( 'site-logo', $args );
18 *
19 */
20
21 /**
22 * Activate the Site Logo plugin.
23 *
24 * @uses current_theme_supports()
25 * @since 3.2
26 */
27 function site_logo_init() {
28 // For transferring existing site logo from Jetpack -> Core
29 if ( current_theme_supports( 'custom-logo' ) && ! get_theme_mod( 'custom_logo' ) && $jp_logo = get_option( 'site_logo' ) ) {
30 set_theme_mod( 'custom_logo', $jp_logo['id'] );
31 delete_option( 'site_logo' );
32 }
33
34 // Only load our code if our theme declares support, and the standalone plugin is not activated.
35 if ( current_theme_supports( 'site-logo' ) && ! class_exists( 'Site_Logo', false ) ) {
36 // Load our class for namespacing.
37 require dirname( __FILE__ ) . '/site-logo/inc/class-site-logo.php';
38
39 // Load template tags.
40 require dirname( __FILE__ ) . '/site-logo/inc/functions.php';
41
42 // Load backwards-compatible template tags.
43 require dirname( __FILE__ ) . '/site-logo/inc/compat.php';
44 }
45 }
46 add_action( 'init', 'site_logo_init' );
47