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 | |
| do_action( "{$taxonomy}_add_form_fields", string $taxonomy ); |
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
| var calculateDistance = function(lat1, lon1, lat2, lon2) { | |
| var R = 6371; // km | |
| var dLat = (lat2-lat1).toRad(); | |
| var dLon = (lon2-lon1).toRad(); | |
| var lat1 = lat1.toRad(); | |
| var lat2 = lat2.toRad(); | |
| var a = Math.sin(dLat/2) * Math.sin(dLat/2) + | |
| Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2); | |
| var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); |
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
| <input type="text" name="attachments[123][field_name]" /> |
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 | |
| add_filter( 'media_send_to_editor', 'ibenic_media_send_to_editor', 10, 3 ); | |
| /** | |
| * Changing the HTML to the editor | |
| * @param string $html | |
| * @param number $id | |
| * @param array $attachment | |
| * @return string |
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 | |
| function rewriting_resources($wp_rewrite) { | |
| $rules = array(); | |
| $terms = get_terms( array( | |
| 'taxonomy' => 'resource_type', | |
| 'hide_empty' => false, | |
| ) ); | |
| $post_type = 'resources'; |
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
| var Library = wp.media.controller.Library; | |
| var oldMediaFrame = wp.media.view.MediaFrame.Post; | |
| // Extending the current media library frame to add a new tab | |
| wp.media.view.MediaFrame.Post = oldMediaFrame.extend({ | |
| initialize: function() { | |
| // Calling the initalize method from the current frame before adding new functionality | |
| oldMediaFrame.prototype.initialize.apply( this, arguments ); |
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 | |
| add_role( | |
| 'new_user_role', | |
| __( 'New User Role', 'yourtextdomain' ), | |
| array( | |
| 'read' => true, | |
| 'edit_posts' => true, | |
| // Various Capabilities | |
| )); |
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 | |
| // Should this data be added? | |
| apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique ); | |
| // Do something before we add the data | |
| do_action( "add_{$meta_type}_meta", $object_id, $meta_key, $_meta_value ); | |
| // Do Something after the data has been added | |
| do_action( "added_{$meta_type}_meta", $mid, $object_id, $meta_key, $_meta_value ); |
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 | |
| add_action( 'load-nav-menus.php', 'ibenic_add_edd_menu_panel' ); | |
| /** | |
| * Adding the menu panel metabox | |
| */ | |
| function ibenic_add_edd_menu_panel() { | |
| add_meta_box( | |
| 'edd-menu-panel', |