• HI:
    I used to use add_meta_box() for add field into post admin, but the problem is than those are add after of textarea post.

    Then I was testing plugins, one of they “Yapb”, and realized that it add a field (type=file) between the title and the textarea content of post and I have throught that it can’t do.

    Reviewing the plugin’s code I see that these plugin used add_filter(‘edit_form_advanced’, array(&$this, ‘_filter_edit_form_advanced’));

    Then, I started my search for konw how do used this command, but i didn’t find nothing.
    Can u help? I dont understand the second parameter, it’s a array? why?

    Thx

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter gonzalesc

    (@gonzalesc)

    anybody?

    I would like to understand this too.
    I’m using add_action(‘edit_form_advanced’,’hookfunction’) for this propose and for displaying it where I want I use js:

    var prephtml= '<div>'+ jQuery('#newfield').html()+ '</div>'
    jQuery('#newfield').html('')
    jQuery('#postdivrich').prepend(prephtml)

    Not happy at all about this workaround, this must be an easier task.

    Answer:
    You put an array as the second parameter if the filter function is inside a Class. Than the object is at first position of the array and the method to be called is at second position.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add field into post admin’ is closed to new replies.