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
| #!/bin/sh | |
| # Check if a service is running. | |
| function running() { | |
| if ps ax | grep -v grep | grep "$1" &> /dev/null; then | |
| return 0 | |
| else | |
| return 1 | |
| fi; | |
| } |
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
| // $dir = path/to/directory/ | |
| function load_files( $dir ) { | |
| // Declare the results array to return. | |
| $results = array(); | |
| // Scan the dir for files. | |
| $files = scandir( $dir ); | |
| // Loop through the files in the directory. |
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 the allowed characters in an array. | |
| $args = array( '!', '(', ')' ); | |
| function maybe_do_allowed_characters( $string, $args ) { | |
| // Bail if fails string sanity check. | |
| if ( ! $string && ! is_string( $string ) ) { return; } | |
| $allowed = array(); | |
| $defaults = array( |
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
| //Disable all automatic updates from wp-core, themes, plugins | |
| $this->addFilter('auto_update_translation', '__return_false'); | |
| $this->addFilter('automatic_updater_disabled', '__return_true'); | |
| $this->addFilter('allow_minor_auto_core_updates', '__return_false'); | |
| $this->addFilter('allow_major_auto_core_updates', '__return_false'); | |
| $this->addFilter('allow_dev_auto_core_updates', '__return_false'); | |
| $this->addFilter('auto_update_core', '__return_false'); | |
| $this->addFilter('wp_auto_update_core', '__return_false'); | |
| $this->addFilter('auto_core_update_send_email', '__return_false'); | |
| $this->addFilter('send_core_update_notification_email', '__return_false'); |
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
| #!/bin/bash | |
| clear | |
| # ---------------------------------------------------------------- | |
| # Variables | |
| # ---------------------------------------------------------------- | |
| # Get current directory name | |
| # --------------------------------- |
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
| [ | |
| { "AF":"Afghanistan" }, | |
| { "AX":"Åland Islands" }, | |
| { "AL":"Albania" }, | |
| { "DZ":"Algeria" }, | |
| { "AS":"American Samoa" }, | |
| { "AD":"Andorra" }, | |
| { "AO":"Angola" }, | |
| { "AI":"Anguilla" }, | |
| { "AQ":"Antarctica" }, |
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
| $query = new WP_Query(array( | |
| 'post_type' => 'post', | |
| )); | |
| $posts_per_row = 2; | |
| $post_counter = 0; | |
| if( have_posts() ) : | |
| while( $query->have_posts() ) : | |
| $query->the_post(); | |
| if( ( ++$post_counter % $posts_per_row ) == 1 || $posts_per_row == 1 ) : | |
| if( $post_counter > 1 ) : |
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
| if( !class_exists( 'OU_Settings' ) ) { | |
| class OU_Settings { | |
| /** | |
| * Option | |
| * | |
| * @since 0.0.1 | |
| * @var array $ordered_uploads_options The settings option array | |
| */ | |
| private $ordered_uploads_options; |
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('activated_plugin','save_error'); | |
| function save_error(){ | |
| file_put_contents(ABSPATH. 'wp-content/error_activation.html', ob_get_contents()); | |
| } |
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
| class="<?php echo ($query->current_post%2 == 0?'odd':'even'); ?>" |