Remember, there are 'TWIG' tools and then there are 'Timber' tools.
The second is WordPress specific.
#!/bin/bash | |
#============================================================================== | |
#TITLE: mysql_backup.sh | |
#DESCRIPTION: script for automating the daily mysql backups on development computer | |
#AUTHOR: tleish | |
#DATE: 2013-12-20 | |
#VERSION: 0.4 | |
#USAGE: ./mysql_backup.sh | |
#CRON: | |
# example cron for daily db backup @ 9:15 am |
<?php | |
// PHP memory limit for this site | |
define( 'WP_MEMORY_LIMIT', '128M' ); | |
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
// Database | |
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
// Explicitely setting url |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
<?php | |
# Database Configuration | |
define( 'DB_NAME', 'XXX' ); | |
define( 'DB_USER', 'XXX' ); | |
define( 'DB_PASSWORD', 'XXX' ); | |
define( 'DB_HOST', '127.0.0.1' ); | |
define( 'DB_HOST_SLAVE', '127.0.0.1' ); | |
define('DB_CHARSET', 'utf8'); | |
define('DB_COLLATE', 'utf8_unicode_ci'); | |
$table_prefix = 'wp_'; |
How to parse Gutenberg content for headless WordPress | |
https://kinsta.com/blog/headless-wordpress-gutenberg/ | |
Adding wrapper to Gutenberg’s Table block | |
https://helloadmin.com/adding-wrapper-to-gutenbergs-table-block/ | |
Display specific Gutenberg blocks of a post outside of the post content in the theme | |
https://florianbrinkmann.com/en/display-specific-gutenberg-blocks-of-a-post-outside-of-the-post-content-in-the-theme-5620/ | |
Modifying the Markup of a Core Block |
{# | |
Relies mostly on a meta array containing appropriate values. | |
site_name is a parameter set as a Twig Global | |
default_share_image is a fallback parameter set as a Twig Global | |
#} | |
<meta charset="UTF-8"> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="robots" content="index, follow" /> | |
<meta property="og:type" content="website" /> |
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Remove Yoast SEO Change existing title or meta template variable | |
* Credit: Moshe Harush | |
* https://stackoverflow.com/questions/36281915/yoast-seo-how-to-create-custom-variables | |
* Last Tested: Unknown | |
*/ | |
// define the wpseo_replacements callback | |
function filter_wpseo_replacements( $replacements ) { |
#!/bin/bash | |
# esed 's/foo/bar/g' files.... | |
script=$1 | |
shift 1 | |
CHANGED=1 # diff returns 1 for differences. (0 for no difference, 2 for errors.) | |
for file in $* | |
do | |
sed -e ${script} ${file} > ${file}~ | |
diff ${file} ${file}~ > /dev/null |
#!/bin/bash | |
################################################### | |
## CREDENCIAIS DO MYSQL NO ARQUIVO /root/.my.cnf ## | |
## ## | |
## [mysql] ## | |
## user=root ## | |
## password='M!nh@S3nh@' ## | |
## host='ip-ou-dns-do-servidor' ## | |
## ## |