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 | |
| // use `erp_states` filter hook to add country states | |
| add_filter( 'erp_states', function ( $states ) { | |
| $states['NL'] = [ | |
| 'DR' => 'Drenthe', | |
| 'FL' => 'Flevoland', | |
| 'FR' => 'Fryslân (fy)', | |
| 'GE' => 'Gelderland', | |
| 'GR' => 'Groningen', |
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
| // source: https://github.com/andymantell/node-wpautop | |
| function _autop_newline_preservation_helper (matches) { | |
| return matches[0].replace( "\n", "<WPPreserveNewline />" ); | |
| }, | |
| function wpautop(pee, br) { | |
| if(typeof(br) === 'undefined') { | |
| br = true; | |
| } |
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 | |
| /** | |
| * $people_id = contact or company id | |
| * meta data saved in 'PREFIX_erp_peoplemeta' table | |
| * for hook documentation see `update_metadata` function located in `wp-includes/meta.php` WordPress core file | |
| */ | |
| add_filter( 'update_erp_people_metadata', function ( $check, $people_id, $meta_key, $meta_value, $prev_value ) { | |
| if ( 'photo_id' === $meta_key ) { |
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
| // required moment-timezone-with-data.js | |
| String.prototype.toLocalTime = function() { | |
| return moment(moment.tz(this, 'YYYY-MM-DD HH:mm:ss', wpTimezone)) | |
| .tz(moment.tz.guess()) | |
| .format('YYYY-MM-DD HH:mm:ss'); | |
| }; | |
| String.prototype.toWPTime = function() { | |
| return moment(this, 'YYYY-MM-DD HH:mm:ss').tz(wpTimezone).format('YYYY-MM-DD HH:mm:ss'); | |
| }; |
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 color_meter(cwith, ccolor) { | |
| if (!cwith && !ccolor) return; | |
| var _cwith = (cwith.charAt(0)=="#") ? cwith.substring(1,7) : cwith; | |
| var _ccolor = (ccolor.charAt(0)=="#") ? ccolor.substring(1,7) : ccolor; | |
| var _r = parseInt(_cwith.substring(0,2), 16); | |
| var _g = parseInt(_cwith.substring(2,4), 16); | |
| var _b = parseInt(_cwith.substring(4,6), 16); |
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
| # Your keymap | |
| # | |
| # Atom keymaps work similarly to style sheets. Just as style sheets use | |
| # selectors to apply styles to elements, Atom keymaps use selectors to associate | |
| # keystrokes with events in specific contexts. Unlike style sheets however, | |
| # each selector can only be declared once. | |
| # | |
| # You can create a new keybinding in this file by typing "key" and then hitting | |
| # tab. | |
| # |
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
| # Your snippets | |
| # | |
| # Atom snippets allow you to enter a simple prefix in the editor and hit tab to | |
| # expand the prefix into a larger code block with templated values. | |
| # | |
| # You can create a new snippet in this file by typing "snip" and then hitting | |
| # tab. | |
| # | |
| # An example CoffeeScript snippet to expand log to console.log: | |
| # |
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
| I use the first | |
| —– BEGIN LICENSE —– | |
| Michael Barnes | |
| Single User License | |
| EA7E-821385 | |
| 8A353C41 872A0D5C DF9B2950 AFF6F667 | |
| C458EA6D 8EA3C286 98D1D650 131A97AB | |
| AA919AEC EF20E143 B361B1E7 4C8B7F04 |
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: WP ERP Extends | |
| * Description: Custom filters and hooks for WP ERP | |
| */ | |
| add_filter( 'erp_hr_employee_types', 'erp_hr_employee_types_custom_types' ); | |
| function erp_hr_employee_types_custom_types( $default_types ) { | |
| $custom_types = [ | |
| 'custom_type_1' => 'Custom Type 1', |