Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • It’ll be easier to add it as a plugin.
    And for update is still the best ??

    Hi,
    try to have a look at this hook :
    delete_post: Runs when a post or page is about to be deleted. Action function arguments: post or page ID.

    add_action(“delete_post”, “your_function”);

    Thread Starter snomead

    (@snomead)

    Ok, I’ve manage to hide the “Leave a Reply” section with some jQuery. Not the best I’ve done … but it’s working ??

    function myplugin_hideCommentForm($id){
    
        if(!myplugin_allowDisplay($id)){
            echo "<script type='text/javascript' charset='utf-8'>
                jQuery(document).ready(function(){
                    jQuery('#respond').css('display','none');
                    jQuery('#commentform').css('display','none');
                    jQuery('.nocomments').css('display','block');
                });
            </script>";
        }
    }
    add_action('comment_form','smsprotect_hideCommentForm');
    Thread Starter snomead

    (@snomead)

    Does anybody know ?
    I want not to modify the core (like comments.php), isn’t any other way to do that ?

    Thanks,
    SnomeaD

    Forum: Plugins
    In reply to: SMS Text Messaging

    You can have a look at https://developer.zong.com and about the bulk services.
    The sms gateway is already in place so you juste have to create your service and create your own program with the API to schedule a weekly function that send sms to your “sms-subscriber”.

    Forum: Plugins
    In reply to: add options to post-new.php

    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 ??

Viewing 6 replies - 1 through 6 (of 6 total)