- Plugin_API
- Action reference
- Filter reference
- WP hooks reference
- How to add administration menu
- action: [admin_menu]
// Create a modal view.
var modal = new wp.media.view.Modal({
// A controller object is expected, but let's just pass
// a fake one to illustrate this proof of concept without
// getting console errors.
controller: { trigger: function() {} }
});
// Create a modal content view.
var ModalContentView = wp.Backbone.View.extend({
template: wp.template( 'modal-content' )
});
// When the user clicks a button, open a modal.
$('.js--open-media-modal').click( function( event ) {
event.preventDefault();
// Assign the ModalContentView to the modal as the `content` subview.
// Proxies to View.views.set( '.media-modal-content', content );
modal.content( new ModalContentView() );
// Out of the box, the modal is closed, so we need to open() it.
modal.open();
});
http://www.sitepoint.com/adding-a-media-button-to-the-content-editor/
add_action('media_buttons', array($this, self::PAGE_SLUG . '_media_button'));
public function Nublico_media_button()
{
echo '<button type="button" id="nublico-media-button" class="button">Add nublico Petition</button>';
}
https://codex.wordpress.org/Shortcode_API
https://github.com/bainternet/bs3_panel_shortcode/ https://lkwdwrd.com/wp-shortcode-wp-html-wordpress-shortcodes-javascript/
add_action ( 'publish_post', [function name] );