Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author miunosoft

    (@miunosoft)

    Hi,

    Use the content_top_{...} filter or its predefined callback method.

    
        public function content_top_{your page slug}_{your tab slug}( $sTopContent ) {
            return $sTopContent 
                . "<h3>Description</h3>"
                . "<p>" 
                    . 'My Descriptions come here.'
                . "</p>";
        }
    

    Replace the part {your page slug} with your page slug and {your tab slug} with your tab slug in the above code.

    Hope this helps.

    Plugin Author miunosoft

    (@miunosoft)

    So did you solve it?

    Thread Starter yst14

    (@yst14)

    That solved it perfectly. Thank you.

    Is there a way to do it without having to use the return function? On one of my pages I have a lot of HTML and wondering if there is a way to do it without breaking it up like that?

    Thanks!

    Plugin Author miunosoft

    (@miunosoft)

    You can also use the do_form_{...} action hook and its predefined callback method.

    
        public function do_form_{page slug}_{tab slug}() {
            
            echo "<h3>do_form_{...}</h3>";
            echo "<p>Insert your custom content here.</p>";
        
        }
    

    It uses an action hook so you don’t have to use the return statement.

    Plugin Author miunosoft

    (@miunosoft)

    Or if you are looking for a way to move some predefined methods to a separate file, you can use the filters as the method names serve as the hook names.

    
    function getTabContent( $sContent ) {
        return $sContent . ' ... additional contents here ... ';
    }
    add_filter( 'content_top_{your page slug}_{your tab slug}', 'getTabContent' );
    

    Closing the topic due to inactivity.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add tab description above form’ is closed to new replies.