• Hi there,

    after successfully launching my first plugin, I am trying to make it more user-friendly by adding features that were requested.

    So, I thought the most elegant solution for EasyPermGals to most flexible would be to allow the user to activate/deactivate the function while writing the post or page.
    So, instead of my plugin adding stuff automatically to every post or page, and also to not force the user to use ]special codes[, I want to add a simple checkbox to the post-new.php and page-new.php files.

    How do I do that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’ve done something like this :

    add_action('admin_menu', 'myplugin_addOption');
    
    function myplugin_addOption()
    {
    	if( function_exists( 'add_meta_box' )) {
    	    add_meta_box( 'myPlugin_id','SMS Protect', 'myPlugin_addMetaBox','page','advanced');
    	    add_meta_box( 'myPlugin_id','SMS Protect', 'myPlugin_addMetaBox','post','advanced');
    	}
    }
    
    function myPlugin_addMetaBox(){
    	?>
    	<p>
    		<label class="selectit" for="comment_status">
    		<input id="myPlugin_status" type="checkbox" value="myPlugin" name="myPlugin_status"/>
    		Blablabla
    		</label>
    	</p>
    	<?php
    }

    It’s such a raw code… but I’m sure you can go along with that ??

    Thread Starter mores

    (@mores)

    thanks, snomead.
    Looks promising, I’ll give it a try!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add options to post-new.php’ is closed to new replies.