Add hooks on form element for integrators to hook into.#738
Add hooks on form element for integrators to hook into.#738jenkoian wants to merge 1 commit intoalleyinteractive:mainfrom
Conversation
By adding these hooks it allows users to do such things as switch to blog/restore blog, which is particularly useful when using something like https://github.com/humanmade/network-media-library where all media will be stored on a single site in the network.
800a13f to
836540b
Compare
|
Hey @jenkoian I've looked over your request here and while I can see the need, this seems better placed in the abstract class class-fieldmanager-field.php, maybe as a companion to the Another option would be to create a subclass in your project that handles the blog switching. |
|
@mslinnea thanks for the reply! Yeah that makes sense, so do you think an action at the beginning and end of protected function render_field( $args = array() ) {
// ...
do_action( 'fieldmanager_pre_render_field' );
$field = $this->fm->element_markup( $data );
do_action( 'fieldmanager_post_render_field' );
//...
}WDYT? |
|
@jenkoian Would it work out better if the hooks were in |
|
@mslinnea do you want me to update the PR? Does it matter if fired before the nonce creation? |
|
@jenkoian Hmm... It may cause an issue. Can you give it a try and see how it works with your use case? |
By adding these hooks it allows users to do such things as switch to
blog/restore blog, which is particularly useful when using something
like https://github.com/humanmade/network-media-library where all media
will be stored on a single site in the network.