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 | |
//---------------------------------------------------------------------------------------------- | |
// Display Timestamps when Debugging WordPress for Speed | |
//---------------------------------------------------------------------------------------------- | |
// | |
// A GIST by Martin Adamko, martin(at)attitude.sk | |
// | |
// It happens from time to time you need to know where the crack is. I assume you are willing | |
// to kick in the WP source and put some 'echos' in there. But WP has 2 functions to help you |
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
diff --git a/classes/PodsAPI.php b/classes/PodsAPI.php | |
index 129badf..571bd1a 100644 | |
--- a/classes/PodsAPI.php | |
+++ b/classes/PodsAPI.php | |
@@ -3020,9 +3020,7 @@ class PodsAPI { | |
if ( !empty( $related_ids ) ) { | |
update_metadata( $object_type, $id, '_pods_' . $related_field[ 'name' ], $related_ids ); | |
- foreach ( $related_ids as $rel_id ) { | |
- add_metadata( $object_type, $id, $related_field[ 'name' ], $rel_id ); |
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
{ | |
"name": "attitude/Functions/get_file_extension" | |
} |
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
{ | |
"name": "attitude/Functions/get_file_filename" | |
} |
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: Snipet: Add/Remove User Contact Methods | |
Plugin URI: http://www.attitude.sk | |
Description: Adds phone field to the user edit screen | |
Version: 0.1.1 | |
Author: Martin Adamko | |
Author URI: http://www.attitude.sk | |
License: The MIT License (MIT) |
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: Snipet: Enable `the_post_thumbnail` | |
Plugin URI: http://www.attitude.sk | |
Description: Displays `Post thumbnail` in post | |
Version: 0.1.0 | |
Author: Mrg. art. Martin Adamko | |
Author URI: http://www.attitude.sk | |
License: The MIT License (MIT) |
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 | |
/** | |
* Merges new SQL argument arrays with defaults | |
* | |
* Differs from {@link array_merge()} and {@link array_merge_recursive()}: | |
* | |
* 1. Array of 'where', 'orderby', 'groupby' and 'join' keys should be | |
* appended and remain unique. | |
* 2. 'select', 'limit' should be overwritten, by new argument on right |
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 | |
/** | |
* Returns formatted file size | |
* | |
* Inspired by {@link http://betterwp.net/wordpress-tips/size_format/}, modified | |
* to work outside of WordPress environment. | |
* | |
* @param int $bytes Size in bytes | |
* @param int $decimals Number of decimal places |
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 | |
/** | |
* Returns metadata for current WordPress attachment or array of attachments | |
* | |
* Reads all attachment metadata and expands it. URLs are rewritten with upload | |
* dir prepended, file size is calculated if function exists. By default url protocol | |
* is removed, use `add_filter()` to disable. | |
* | |
* @uses {@link apply_filters() http://codex.wordpress.org/Function_Reference/apply_filters} |
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 | |
/** | |
* Decodes JSON string if needed | |
* | |
* @uses json_decode() | |
* @author Martin Adamko <@martin_adamko> | |
* @licence The MIT Licence <http://opensource.org/licenses/MIT> | |
* | |
* @param string $str String to decode if needed |
OlderNewer