This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command
$ docker-compose up -d
# To Tear Down
$ docker-compose down --volumes
// Source: https://blog.templatetoaster.com/update-old-urls-in-database/ | |
// How to Change/Update links with MySQL | |
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find string’, ‘replace string’); | |
// For replacing the URL across all database tables, Click on SQL tab and in the panel type the below code: | |
UPDATE wp_options SET option_value = replace(option_value, 'Existing URL', 'New URL') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET post_content = replace(post_content, 'Existing URL', 'New URL'); |
<?php | |
/* ADD GTM TO HEAD AND BELOW OPENING BODY */ | |
add_action('wp_head', 'google_tag_manager_head', 20); | |
function google_tag_manager_head() { ?> | |
<!-- Google Tag Manager --> | |
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | |
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
<label for="country">Country</label><span style="color: red !important; display: inline; float: none;">*</span> | |
<select id="country" name="country" class="form-control"> | |
<option value="Afghanistan">Afghanistan</option> | |
<option value="Åland Islands">Åland Islands</option> | |
<option value="Albania">Albania</option> | |
<option value="Algeria">Algeria</option> | |
<option value="American Samoa">American Samoa</option> | |
<option value="Andorra">Andorra</option> | |
<option value="Angola">Angola</option> |
Guidelines for upgrading the minimum PHP version requirements of packages and projects.
This isn't meant to be an exhaustive guide to upgrading, but as a checklist for the most important upgrades.
The first version to support namespaces - any relevant PHP packages/projects usually have this version as the minimum requirement, so this document won't concern itself with upgrades prior to that.
function prevent_slug_duplicates( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) { | |
$check_post_types = array( | |
'post', | |
'page', | |
'custom_post_type' | |
); | |
if ( ! in_array( $post_type, $check_post_types ) ) { | |
return $slug; | |
} |