• I need to hide little notes for Administrators when adding and editing posts. This 5-year old forum string was excellent, and works when the post is viewed live on the web in a desktop browser. But the notes are visible when viewed in mobile browsers.

    I know there are plugins to add boxes etc. to the page margin but I only need a brief little note right in the text area of the post.

    Can the following code given in that old forum post be updated to hide it in mobile browsers too? Here it is:

    <?php // [mm-hide-text]some text here[/mm-hide-text]
    function mm_hide_text_func($atts, $content=null) {
       extract(shortcode_atts(array('noatts' => 'Unknown' ), $atts));
       $output = '';
       if (!is_null($content) && current_user_can('administrator')) {
          $output = $content;
       }
    
       return $output;
    }
    add_shortcode('mm-hide-text', 'mm_hide_text_func');
    ?>
  • The topic ‘How to hide notes in a post, even when viewed on mobile browsers’ is closed to new replies.