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 | |
while true; do | |
POSTS=$(wp db query 'SELECT ID FROM wp_posts WHERE post_type="attachment" AND post_date < "2022-06-05" LIMIT 10000;' --skip-column-names | paste -s -d ' ' -) | |
if ! [ -z "$POSTS" ]; then | |
wp post delete $POSTS --force | |
else | |
exit 0 | |
fi | |
done |
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
/* fixes */ | |
body {-webkit-text-size-adjust: 100% !important;} | |
html * {max-height:1000000px; min-height: 0; min-width: 0;} | |
body, | |
body * { | |
-moz-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
vertical-align: middle; | |
} |
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
# main | |
location / { | |
index index.php; | |
try_files $uri $uri/ @bitrix; | |
} | |
location @bitrix { | |
fastcgi_pass unix:/run/php/phpX.X-fpm.$pool_name.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root/bitrix/urlrewrite.php; |
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 | |
/** | |
* Gets cached carbon fields option or get it if it not isset in cache | |
* | |
* @param string $option Option name | |
* | |
* @return mixed | |
*/ | |
function carbon_get_theme_option_cached( $option ) { | |
$option_value = wp_cache_get( $option, 'crb_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
<?php | |
/** | |
* Add post meta to search query in where part | |
* | |
* @param string $where Where query part | |
* | |
* @return string | |
*/ | |
function modify_wp_search_where( $where ) { | |
if ( is_search() ) { |
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 getProgressClass(type, value) { | |
if ( type == 'meta_t' ) { | |
if (value < 400) { | |
var progress_class = 'ok'; | |
} | |
else if (value > 600) { | |
var progress_class = 'bad'; | |
} | |
else { | |
var progress_class = 'good'; |
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
{ | |
"annotations": { | |
"list": [ | |
{ | |
"$$hashKey": "object:143", | |
"builtIn": 1, | |
"datasource": "-- Grafana --", | |
"enable": true, | |
"hide": true, | |
"iconColor": "rgba(0, 211, 255, 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
<?php | |
/* | |
* | |
* Register post type "service" | |
* | |
*/ | |
add_action('init', 'register_service', 0); | |
function register_service() { | |
register_post_type('service', [ | |
'label' => null, |
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
/* | |
* | |
* Hide dashboard page from admin menu | |
* | |
*/ | |
function remove_menus() { | |
remove_menu_page('index.php'); | |
} | |
add_action('admin_menu', 'remove_menus'); |
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 | |
# folder with sites | |
INPUT_DIR='/home/' | |
# path to file for data | |
OUTPUT_FILE='data.txt' | |
find $INPUT_DIR -name 'wp-config.php' > /tmp/files.txt | |
echo -n > $OUTPUT_FILE |
NewerOlder