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
| /** | |
| * Title: Wordpress - Remove Media Add new button | |
| * Author: Mattias Ghodsian | |
| * Description: Remove Media add new button from admin panel | |
| * Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
| * Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
| */ | |
| function remove_submenus() { | |
| global $submenu; |
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
| /** | |
| * Title: Set tags for custom post type | |
| * Author: Mattias Ghodsian | |
| * Description: Set tags for custom post type | |
| * Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
| * Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
| */ | |
| function cpt_tags( $query ) { | |
| if ( $query->is_tag() && $query->is_main_query() ) { | |
| $query->set( 'post_type', array( 'post', 'movies', 'test', 'world' ) ); |
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
| <a href="#">buy now</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
| /** | |
| * Title: Wordpress - Modify/Replace handler source | |
| * Author: Mattias Ghodsian | |
| * Description: This script was writen to solve broken plugin asset urls (.js/.css) with Bedrock/Trellis as environment | |
| * Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
| * Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
| */ | |
| add_filter( 'script_loader_src', 'wp_plugin_assets_path_fix', 10, 2 ); | |
| add_filter( 'style_loader_src', 'wp_plugin_assets_path_fix', 10, 2 ); | |
| function wp_plugin_assets_path_fix( $src, $handle ) |
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
| /** | |
| * Title: Get gists | |
| * Author: Mattias Ghodsian | |
| * Description: List any users public gists | |
| * Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
| * Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
| */ | |
| $profile_url = "https://api.github.com/users/mattiasghodsian/gists"; | |
| $options = array('http' => array('user_agent'=> $_SERVER['HTTP_USER_AGENT'])); |
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
| /** | |
| * Title: [Woocommerce] Add OnSale filter | |
| * Author: Mattias Ghodsian | |
| * Description: Add onsale option to front-end users | |
| * Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
| * Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
| */ | |
| add_filter( 'woocommerce_get_catalog_ordering_args', 'wcs_get_catalog_ordering_args' ); | |
| function wcs_get_catalog_ordering_args( $args ) { |
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
| /** | |
| * Title: [Woocommerce] Product Select2 input field | |
| * Author: Mattias Ghodsian | |
| * Description: Let's users search products in wp-admin / Woocommerce Product data | |
| * Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
| * Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
| */ | |
| function woocommerce_wp_product_select2( $field ) { | |
| global $thepostid, $post, $woocommerce; | |
| $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; |
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
| /** | |
| * Title: [Woocommerce] Custom user column & searchable meta | |
| * Author: Mattias Ghodsian | |
| * Description: Add new column with meta data & searchable in users.php | |
| * Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
| * Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
| */ | |
| // Create user column | |
| add_filter( 'manage_users_columns', 'new_modify_user_table' ); |
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
| /** | |
| * Title: Get image from ACF Plugin (return value most image ID) | |
| * Author: Mattias Ghodsian | |
| * Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
| * Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
| * ----- | |
| * @param array $params | |
| * @return string | |
| */ | |
| function acfImage( $params = [] ) |
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
| # Place wsl.conf in /etc | |
| # Restart LxssManager by executing command Restart-Service LxssManager in PowerShell as admin | |
| # For more options read: https://devblogs.microsoft.com/commandline/automatically-configuring-wsl/ | |
| [automount] | |
| enabled = true | |
| root = /mnt/ | |
| options = "metadata,umask=22,fmask=11" | |
| mountFsTab = false |