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: No User Enumeration | |
| * Description: Network-wide hardening: strip user-enumeration vectors from | |
| * REST, oembed, feeds, author archives, sitemaps, and the | |
| * REST API root index. Admin-context callers that genuinely | |
| * need /wp/v2/users (Gutenberg author selector, plugins doing | |
| * user search) keep access via an `edit_posts` capability | |
| * check. | |
| * Author: Jaakko Pöntinen (Mainio Mooses) |
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 | |
| if (is_single()) { | |
| if( has_term('', 'sijainti', $post->ID) ){ | |
| $sijainnit = wp_get_post_terms( $post->ID, 'sijainti' ); | |
| $target = $sijainnit[0]->term_id; | |
| if (in_array($target, $gifts_valid_locations)) { | |
| $mm_donation__gift_key = array_search($target, $gifts_valid_locations); | |
| return $gifts[$mm_donation__gift_key]; | |
| } | |
| $target_progenitor = $target; |
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 | |
| /** | |
| * Debug helper, place near the top of your functions.php | |
| * Use with write_log($var) to write $var contents into debug.log | |
| */ | |
| function write_log( $data ) { | |
| if ( true === WP_DEBUG ) { | |
| if ( is_array( $data ) || is_object( $data ) ) { | |
| error_log( print_r( $data, true ) ); | |
| } else { |
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 | |
| // Correct way to use "is_read" and/or "is_starred" with GFAPI::get_entries | |
| $search_criteria = array( | |
| 'status' => 'active', | |
| 'field_filters' => array( | |
| 'mode' => 'all', | |
| array( | |
| 'key' => '8', | |
| 'value' => 'abc', |