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
| $link = [ | |
| 'linktype' => 'DETAILVIEWBASIC', | |
| 'linklabel' => vtranslate( 'Parent Button Label' ) | |
| ]; | |
| $link = Vtiger_Link_Model::getInstanceFromValues( $link ); | |
| $link->addChildLink( Vtiger_Link_Model::getInstanceFromValues( [ | |
| 'linklabel' => vtranslate( 'Child Link Label' ), | |
| 'linkurl' => '?url_to_go_to' | |
| ] ) ); |
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 | |
| declare(strict_types=1); | |
| /* | |
| This extends/replaces the OrmResolver in order to fetch the token from an associated table, | |
| when you have Users table and Tokens table, where you may have many tokens to same user. | |
| ``` | |
| $service->loadIdentifier( 'Authentication.Token', [ | |
| 'tokenField' => 'Tokens.token', |
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
| { | |
| "type": "icons", | |
| "group": "FontAwesome - Brands", | |
| "assets": [ | |
| { | |
| "name": "xing-square", | |
| "icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><g class=\"nc-icon-wrapper\" fill=\"#000000\"><path d=\"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM140.4 320.2H93.8c-5.5 0-8.7-5.3-6-10.3l49.3-86.7c.1 0 .1-.1 0-.2l-31.4-54c-3-5.6.2-10.1 6-10.1h46.6c5.2 0 9.5 2.9 12.9 8.7l31.9 55.3c-1.3 2.3-18 31.7-50.1 88.2-3.5 6.2-7.7 9.1-12.6 9.1zm219.7-214.1L257.3 286.8v.2l65.5 119c2.8 5.1.1 10.1-6 10.1h-46.6c-5.5 0-9.7-2.9-12.9-8.7l-66-120.3c2.3-4.1 36.8-64.9 103.4-182.3 3.3-5.8 7.4-8.7 12.5-8.7h46.9c5.7-.1 8.8 4.7 6 10z\"></path></g></svg>", | |
| "set_id": 1 | |
| }, | |
| { |
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
| ddev ssh | |
| sudo apt-get install build-essential autoconf zlib1g-dev php-dev php-pear | |
| sudo pecl channel-update pecl.php.net | |
| sudo pecl install grpc | |
| # Add this to php.ini | |
| #extension=grpc.so |
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 | |
| /* | |
| This will enable user authentication if you migrated the user/pass from yii database to the wordpress db | |
| So you can support both wordpress standard users authentication and your previous yii2 users | |
| */ | |
| add_filter( 'authenticate', function( $user, $username, $password ) { | |
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 | |
| // When you like your admin in LTR but you have to edit a gutenberg page that is in hebrew or arabic that is RTL, | |
| // and to avoid switching the user language, just paste this code on your functions.php and on the url of the edit page add | |
| // the query param: dir=rtl and from there on the gutenberg editor area will keep RTL | |
| // if you wish to all content to display in certain direction | |
| define( 'VISUAL_EDITOR_DEFAULT_DIRECTION', 'rtl' ); |
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 Woocommerce Vendors Taxonomy to WC Order and enable Metabox on Shop Order | |
| add_action( 'init', function() { | |
| if ( defined( 'WC_PRODUCT_VENDORS_TAXONOMY' ) ) register_taxonomy_for_object_type( WC_PRODUCT_VENDORS_TAXONOMY, 'shop_order' ); | |
| } ); | |
| add_action( 'save_post', 'wcpv_product_vendors_save_order_vendor' ); | |
| function wcpv_product_vendors_save_order_vendor( $order_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
| <?php | |
| $realm = 'My Realm Name'; | |
| //user => password | |
| $users = [ 'user1' => 'pass1', 'user2' => 'pass2' ]; | |
| $authenticated = !empty( $_SERVER[ 'PHP_AUTH_DIGEST' ] ); | |
| if ( $authenticated && !( $data = http_digest_parse( $_SERVER[ 'PHP_AUTH_DIGEST' ] ) ) || !isset( $users[ $data[ 'username' ] ] ) ) { |
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 | |
| /* Product Vendors */ | |
| add_action( 'init', function() { | |
| add_post_type_support( 'product', [ 'author' ] ); | |
| add_post_type_support( 'shop_order', [ 'author' ] ); | |
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
| [ | |
| { | |
| "key": "group_63ee7c57739d9", | |
| "title": "Stripe Accounts", | |
| "fields": [ | |
| { | |
| "key": "field_63ee7c579826f", | |
| "label": "Stripe Accounts", | |
| "name": "stripe_accounts", | |
| "aria-label": "", |