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
| <?php | |
| /** | |
| * Walker for integration of WordPress custom menu with Bootstrap navbar. | |
| */ | |
| class Walker_Navbar_Menu extends Walker_Nav_Menu { | |
| public $dropdown_enqueued; | |
| /** |
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
| <?php | |
| /* | |
| Plugin Name: Pug Bomb API Endpoint | |
| Description: Adds an API endpoint at /api/pugs/$n_pugs | |
| Version: 0.1 | |
| Author: Brian Fegter | |
| Author URL: http://coderrr.com | |
| */ | |
| class Pugs_API_Endpoint{ |
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
| /** | |
| * restrict_admin is a simple function to restrict access to WordPress backend based on capabilities | |
| * Form more capabilities read http://goo.gl/HlHr4 | |
| * Usage, capability per role: | |
| * | |
| * Administrator => activate_plugins | |
| * Editor => moderate_comments | |
| * Author => edit_published_posts | |
| * Contributor => edit_posts | |
| * Subscriber => read |
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
| <?php | |
| // Add Theme and Plugin Editor to Admin Bar (to save time!) | |
| function admin_bar_code_editor_option() { | |
| global $wp_admin_bar; | |
| if ( !is_super_admin() || !is_admin_bar_showing() ) | |
| return; | |
| $wp_admin_bar->add_menu( | |
| array( | |
| 'id' => 'edit-code', | |
| 'title' => __('Code Editor'), |
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
| <?php | |
| date_default_timezone_set('America/Los_Angeles'); | |
| class Deploy { | |
| /** | |
| * A callback function to call after the deploy has finished. | |
| * | |
| * @var callback |
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
| <!*!* START export Code !*!*> | |
| YToyOntpOjA7YTo0OntzOjE6InAiO2E6Nzp7czoxMjoicG9zdF9jb250ZW50IjtzOjA6IiI7czoxMDoicG9zdF90aXRsZSI7czo0OiJ0YWJzIjtzOjExOiJwb3N0X3N0YXR1cyI7czo3OiJwdWJsaXNoIjtzOjEyOiJwb3N0X2V4Y2VycHQiO3M6MDoiIjtzOjE0OiJjb21tZW50X3N0YXR1cyI7czo2OiJjbG9zZWQiO3M6MTM6InBvc3RfcGFzc3dvcmQiO3M6MDoiIjtzOjk6InBvc3RfdHlwZSI7czo1OiJiYV9zaCI7fXM6NDoibWV0YSI7YTo4OntzOjExOiJfYmFzY3NoX3RhZyI7YToxOntpOjA7czo0OiJ0YWJzIjt9czoxMjoiX2Jhc2NzaF90eXBlIjthOjE6e2k6MDtzOjg6ImFkdmFuY2VkIjt9czoxMToiX2Jhc2NzaF9waHAiO2E6MTp7aTowO3M6ODYzOiIkR0xPQkFMU1sndGFiX2NvdW50J10gPSAwOw0KZG9fc2hvcnRjb2RlKCAkY29udGVudCApOw0KJGkgPSAwOw0KaWYoIGlzX2FycmF5KCAkR0xPQkFMU1sndGFicyddICkgKXsNCglmb3JlYWNoKCAkR0xPQkFMU1sndGFicyddIGFzICR0YWIgKXsNCg0KCQkkaSsrOw0KDQoJCS8vIFJlbW92ZSB3aGl0ZXNwYWNlIGZvciAjaWQNCgkJJHRpdGxlID0gJHRhYlt0aXRsZV07DQoJCSR0aXRsZSA9IHN0cl9yZXBsYWNlKCcgJywgJycsICR0aXRsZSk7DQoNCgkJLy8gU2V0IHRoZSBhY3RpdmUgdGFiDQoJCWlmICgkaSA9PSAxKSB7DQoJCQkkdGFic1tdID0gJzxkZCBjbGFzcz0iYWN0aXZlIj48YSBocmVmPSIjJy4kdGl0bGUuJyI+Jy4kdGFiWyd0aXRsZSddLic8L2E+PC |
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
| <?php | |
| /* | |
| Plugin Name: custom-feed | |
| Plugin URI: http://en.bainternet.info | |
| Description: Custom categories feed | |
| Version: 1.0 | |
| Author: bainternet | |
| Author URI: http://en.bainternet.info | |
| */ |
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
| <?php | |
| add_shortcode('ajax_login','ajaxlogin_shortcode_handler'); | |
| /** | |
| * Usage: [ajax_login] | |
| */ | |
| function ajaxlogin_shortcode_handler($atts,$content=null){ | |
| if (is_user_logged_in()) | |
| return; | |
| $retval = '<p id="message" style="color:red"></p>' |
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
| <?php | |
| if (!class_exists('Tax_CTP_Filter')){ | |
| /** | |
| * Tax CTP Filter Class | |
| * Simple class to add custom taxonomy dropdown to a custom post type admin edit list | |
| * @author Ohad Raz <admin@bainternet.info> | |
| * @version 0.1 | |
| */ | |
| class Tax_CTP_Filter | |
| { |
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
| <?php | |
| /** | |
| * function to limit the displayed posts to the current user's posts only | |
| */ | |
| function _parse_query_useronly( $wp_query ) { | |
| // first check if we're on the right page | |
| if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) { | |
| // check to make sure the user doesn't have administrative capabilities | |
| if ( !current_user_can( 'edit_others_posts' ) ) { | |
| // if the user doesn't have administrative queries then limit the query to just that user |