-
Open Ampps Application -> MySQL Tab -> Configuration.
-
In [mysqld] section, add the following line:
innodb_force_recovery = 1
-
Save the file and try starting MySQL
-
Remove that line which you just added and Save.
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
/** | |
* Sends /page/ paths with a negative category parameter to base uri | |
*/ | |
function csm_no_negative_cat_list() { | |
if ( isset( $_GET['cat'] ) && $_GET['cat'] == -1 ) { | |
$uri = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER["REQUEST_URI"]; | |
$parsed_uri = parse_url( $uri ); | |
$parsed_path = preg_replace( "/\/page\/[0-9]+/", '', $parsed_uri['path'] ); |
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 | |
/** | |
* The purpose of this code is to show how you can use theme mods that will fall back to | |
* the already-set mods of the parent theme. So, when a child theme is active, the code | |
* checks, in the following order: 1) child theme mod, 2) parent theme mod, 3) default. | |
*/ | |
function jt_get_theme_mod( $name, $default = false ) { | |
if ( is_child_theme() ) |
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 | |
/** | |
* Get the attachment ID of an image from it's URL. | |
* | |
* @param string $image_url The URL for the image you need an id for. | |
* | |
* @return mixed | |
*/ | |
function theme_get_image_id($image_url) { |
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 | |
/** | |
* Plugin Name: Convert ACF PHP to JSON | |
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON. | |
*/ | |
namespace ConvertAcfPhpToJson; | |
/** | |
* Add submenu item under 'Custom Fields' |
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($) { | |
// Any generic functions can go here... | |
$(document).ready(function($){ | |
// Anything that needs to wait for the document to be ready goes here | |
}); |
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 | |
/** | |
* Removes comment spam anchors with empty nodeValues. | |
* | |
* @param $comment_content | |
* | |
* @return string | |
*/ | |
function dmm_remove_empty_anchors_in_comments( $comment_content ) { | |
// Grab the comment content. |
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
$comment_anchors = $dom_comment->getElementsByTagName( 'a' ); | |
for ( $i = $comment_anchors->length; --$i >=0; ) : | |
$comment_anchor = $comment_anchors->item( $i ); | |
if ( trim ( $comment_anchor->nodeValue ) === '' ) : | |
$comment_anchor->parentNode->removeChild( $comment_anchor ); | |
endif; | |
endfor; |
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
/** | |
* Get the attachment ID of an image from it's URL. | |
* | |
* @link https://pippinsplugins.com/retrieve-attachment-id-from-image-url/ | |
* | |
* @param $image_url | |
* | |
* @return mixed | |
*/ | |
function dmgist_get_image_id($image_url) { |
NewerOlder