This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
register_activation_hook( __FILE__, 'my_plugin_activation' ); | |
function my_plugin_activation() { | |
add_option( 'my_plugin_activated', time() ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
register_activation_hook( __FILE__, 'my_plugin_activation' ); | |
function my_plugin_activation() { | |
flush_rewrite_rules(); | |
} | |
add_action( 'init', 'my_custom_post_type' ); | |
function my_custom_post_type() { | |
$args = array( | |
'public' => true, | |
'label' => 'Board Games' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
register_activation_hook( __FILE__, 'my_plugin_activation' ); | |
function my_plugin_activation() { | |
add_option( 'my_plugin_activation','just-activated' ); | |
} | |
add_action( 'admin_init','my_plugin_initialize' ); | |
function my_plugin_initialize() { | |
if( is_admin() && get_option( 'my_plugin_activation' ) == 'just-activated' ) { | |
delete_option( 'my_plugin_activation' ); | |
flush_rewrite_rules(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'init', 'my_custom_post_type' ); | |
function my_custom_post_type() { | |
$args = array( | |
'public' => true, | |
'label' => 'Board Games' | |
); | |
register_post_type( 'boardgames', $args ); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global $jal_db_version; | |
$jal_db_version = '1.0'; | |
function jal_install() { | |
global $wpdb; | |
global $jal_db_version; | |
$table_name = $wpdb->prefix . 'liveshoutbox'; | |
$charset_collate = $wpdb->get_charset_collate(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
register_activation_hook( __FILE__, 'my_plugin_activation' ); | |
function my_plugin_activation() { | |
global $wp_version; | |
$php = '5.3'; | |
$wp = '3.8'; | |
if ( version_compare( PHP_VERSION, $php, '<' ) ) { | |
deactivate_plugins( basename( __FILE__ ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
register_deactivation_hook( __FILE__, 'my_plugin_deactivation' ); | |
function my_plugin_deactivation() { | |
// Deactivation rules here | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myplugin_flush_rewrites_deactivate() { | |
flush_rewrite_rules(); | |
} | |
register_deactivation_hook( __FILE__, 'myplugin_flush_rewrites_deactivate' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
register_deactivation_hook( __FILE__, 'my_plugin_deactivation' ); | |
function my_plugin_deactivation() { | |
delete_option('rewrite_rules'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
register_uninstall_hook( __FILE__, 'my_plugin_uninstall' ); | |
function my_plugin_uninstall() { | |
// Uninstallation stuff here | |
} |
OlderNewer