-
Open the Terminal
-
Use
mysqldump
to backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql
-
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
<?php | |
function my_update_cookie( $logged_in_cookie ) { | |
$_COOKIE[ LOGGED_IN_COOKIE ] = $logged_in_cookie; | |
} | |
add_action( 'set_logged_in_cookie', 'my_update_cookie' ); | |
wp_localize_script( | |
'theme_js', | |
'theme_data', |
<?php | |
function a_theme_auth_options_page() | |
{ | |
add_options_page( "A-Theme Auth options", "A-Theme Auth", "manage_options", "a-theme-auth", "a_theme_auth_options" ); | |
} | |
add_action( 'admin_menu', 'a_theme_auth_options_page' ); | |
function register_a_theme_auth_settings() | |
{ |
$('#update-cat-featured-img, #add-cat-featured-img').click(function(e) { | |
e.preventDefault(); | |
var custom_uploader = wp.media({ | |
title: 'Featured Image', | |
button: { | |
text: 'Insert image' | |
}, | |
multiple: false // Set this to "add" to allow multiple files to be selected | |
}) |
<?php | |
function athdata_get_companies( WP_REST_Request $request ) { | |
$draw = $request['draw']; | |
$start = $request['start']; //Start is the offset | |
$length = $request['length']; //How many records to show | |
$column = $request['order'][0]['column']; //Column to orderBy | |
$dir = $request['order'][0]['dir']; //Direction of orderBy | |
$searchValue = $request['search']['value']; //Text search value | |
$args = [ |
<?php | |
//Register login route | |
//Test in postman with - www.yourdomain.com/wp-json/login-user/v1/user | |
function uab_register_endpoints() | |
{ | |
register_rest_route('login-user/v1', '/user/', array( | |
'methods' => 'POST', | |
'callback' => 'uab_login_user' | |
)); |
<?php | |
function ath_register_event_taxonomies() | |
{ | |
$ath_taxonomy = new Ath_Taxonomy(); | |
$ath_taxonomy->create_hierarchical_taxonomy( "event", "event_category", "Event Categories", "Event Category", "event-category" ); | |
$ath_taxonomy->create_taxonomy( "event", "event_tag", "Event Tags", "Event Tag", "event-tag" ); | |
} | |
add_action( 'init', 'ath_register_event_taxonomies' ); |
(function($) { | |
$(".submit-contact-form").on("click", function(e) { | |
e.preventDefault(); | |
$.ajax({ | |
url: theme_data.site_url + 'wp-json/send-contact-form/v1/contact', | |
method: 'POST', | |
data: data | |
}).done(function(data){ |
<template> | |
<div v-if="text"> | |
<div v-html="formattedText"></div> | |
<span v-if="text.length > maxChars"> | |
<a href="#" v-if="!isReadMore" @click.prevent="triggerReadMore()">{{ readMoreText }}</a> | |
<a href="#" v-if="isReadMore && readLessText" @click.prevent="triggerReadLess()">{{ readLessText }}</a> | |
</span> | |
</div> | |
</template> |