[wp-trac] [WordPress Trac] #35982: The new feature 'site logo' is not working on-the-fly (postMessage)

WordPress Trac noreply at wordpress.org
Fri Mar 4 15:47:33 UTC 2016


#35982: The new feature 'site logo' is not working on-the-fly (postMessage)
-------------------------------+--------------------------
 Reporter:  sidati             |       Owner:  westonruter
     Type:  defect (bug)       |      Status:  reopened
 Priority:  normal             |   Milestone:  4.5
Component:  Customize          |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  javascript
-------------------------------+--------------------------

Comment (by sidati):

 Hi @westonruter,

 Sorry about the delay, it takes time to reproduce the bug cause i removed
 the old code and use the logo functions, anyway this is the function :
 {{{

         function wp123_get_logo(){

                 if (!$img_id = get_theme_mod('site_logo')) {
                         return;
                 }

                 list($img_src) = wp_get_attachment_image_src($img_id,
 array(150, 50));

                 ?><a href="#">
                         <img class="site-logo" src="<?php echo
 esc_url($img_src) ?>" alt=">">
                 </a><?php
         }
 }}}

 then i call it in my header, remember this is for the 4.5 BETA 1, i didn't
 test it with the BETA 2, i tough it was the transport property so i add
 this line as i said in my ticket :
 {{{#!php
 <?php
 $wp_customize->get_setting( 'site_logo' )->transport = 'postMessage';
 }}}

 This will change the logo (image) on-the-fly but also the page will
 refreshed after that.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35982#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list