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

    (@thaikolja)

    Placeholder? You mean a button to show the secondary title input box?

    Thread Starter master412160

    (@master412160)

    No, in the input box you type the secondary title

    placeholder=”add your secondary title here”.

    http://www.w3schools.com/tags/att_input_placeholder.asp

    Plugin Author thaikolja

    (@thaikolja)

    Ah, I get it. Will implement it 🙂

    Great plugin and thanks for adding the Placeholder. I am trying to write a function to change the placeholder copy for a custom post type called “company” so that my users know what the space should be used for. I am not very experienced in writing functions so any help is appreciated.

    function change_secondary-title-text( $subtitle ){
         $screen = get_current_screen();
         if  ( 'company' == $screen->post_type ) {
              $subtitle = 'City, State';
         }
         return $subtitle;
    }
    add_filter( 'secondary_post_title', 'change_secondary-title-text' );
    Plugin Author thaikolja

    (@thaikolja)

    msacco6: You want to replace the placeholder for the secondary title input box within a add/edit post screen, am I getting you right?

    So far, there’s no implemented way of doing this. However, in the next version I’ve planned to add some filters and action hooks that let you change exactly these kind of things.

    In the meantime, you can either replace the string manually in includes/admin.php on line 39 or add this jQuery script to scripts/admin.js (you can also implement this individually if you don’t want to change the plugin’s files, see wp_enqueue_script for more):

    jQuery(document).ready(function() {
    	jQuery("#secondary-title-text").attr("placeholder", "City, State");
    });
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Small feature idea: placeholder’ is closed to new replies.