Changeset 2851529
- Timestamp:
- 01/19/2023 10:42:11 PM (19 months ago)
- Location:
- wp-inci
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-inci/tags/1.6.1/blocks/product.php
r2851443 r2851529 61 61 62 62 /** 63 * Block product callback.64 *65 * @param array $fields Block fields.66 *67 * @return string68 */69 function wi_product_block_callback( $fields ) {70 71 $output = '<div class="block">72 <div class="block__product">73 <div class="wp-inci">';74 75 $start = '<h3>';76 $end = '</h3>';77 $title = esc_html( get_the_title( $fields['product'] ) );78 79 if ( isset( $fields['title'] ) && '' !== $fields['title'] ) {80 $title = esc_html( $fields['title'] );81 }82 83 if ( $fields['linked'] ) {84 $start = '<h3><a title="' . $title . '" href="' . get_permalink( $fields['product'] ) . '">';85 $end = '</a></h3>';86 }87 88 $output .= $start . $title . $end;89 90 $safety = 'true';91 92 if ( isset( $fields['safety'] ) && true === $fields['safety'] ) {93 $safety = 'false';94 }95 96 if ( ! $fields['list'] ) {97 $output .= ( Wp_Inci_Frontend::get_instanceFrontend() )->getIngredientsTable(98 $fields['product'],99 $safety100 );101 }102 $output .= '</div>103 </div>104 </div>';105 106 return $output;107 }108 109 /**110 63 * Register Product block. 111 64 * … … 132 85 ->set_category( 'wp-inci' ) 133 86 ->set_icon( 'wp-inci' ) 134 ->set_render_callback( wi_product_block_callback( Block::make()->get_fields() ) ); 87 // @codingStandardsIgnoreStart 88 ->set_render_callback( 89 function ( $fields, $attributes, $inner_blocks ) { 90 $output = '<div class="block"> 91 <div class="block__product"> 92 <div class="wp-inci">'; 93 94 $start = '<h3>'; 95 $end = '</h3>'; 96 $title = esc_html( get_the_title( $fields['product'] ) ); 97 98 if ( isset( $fields['title'] ) && '' !== $fields['title'] ) { 99 $title = esc_html( $fields['title'] ); 100 } 101 102 if ( $fields['linked'] ) { 103 $start = '<h3><a title="' . $title . '" href="' . get_permalink( $fields['product'] ) . '">'; 104 $end = '</a></h3>'; 105 } 106 107 $output .= $start . $title . $end; 108 109 $safety = 'true'; 110 111 if ( isset( $fields['safety'] ) && true === $fields['safety'] ) { 112 $safety = 'false'; 113 } 114 115 if ( ! $fields['list'] ) { 116 $output .= ( Wp_Inci_Frontend::get_instanceFrontend() )->getIngredientsTable( 117 $fields['product'], 118 $safety 119 ); 120 } 121 $output .= '</div> 122 </div> 123 </div>'; 124 125 echo $output; 126 } 127 // @codingStandardsIgnoreEnd 128 ); 135 129 } 136 130 -
wp-inci/tags/1.6.1/vendor/autoload.php
r2851449 r2851529 10 10 require_once __DIR__ . '/composer/autoload_real.php'; 11 11 12 return ComposerAutoloaderInit a90277c3f4caff804b116f42616abbec::getLoader();12 return ComposerAutoloaderInit::getLoader(); -
wp-inci/tags/1.6.1/vendor/composer/autoload_real.php
r2851449 r2851529 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit a90277c3f4caff804b116f42616abbec5 class ComposerAutoloaderInit 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit a90277c3f4caff804b116f42616abbec', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit a90277c3f4caff804b116f42616abbec', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit a90277c3f4caff804b116f42616abbec::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit::getInitializer($loader)); 33 33 34 34 $loader->register(true); 35 35 36 $includeFiles = \Composer\Autoload\ComposerStaticInit a90277c3f4caff804b116f42616abbec::$files;36 $includeFiles = \Composer\Autoload\ComposerStaticInit::$files; 37 37 foreach ($includeFiles as $fileIdentifier => $file) { 38 composerRequire a90277c3f4caff804b116f42616abbec($fileIdentifier, $file);38 composerRequire($fileIdentifier, $file); 39 39 } 40 40 … … 48 48 * @return void 49 49 */ 50 function composerRequire a90277c3f4caff804b116f42616abbec($fileIdentifier, $file)50 function composerRequire($fileIdentifier, $file) 51 51 { 52 52 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { -
wp-inci/tags/1.6.1/vendor/composer/autoload_static.php
r2851449 r2851529 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit a90277c3f4caff804b116f42616abbec7 class ComposerStaticInit 8 8 { 9 9 public static $files = array ( … … 58 58 { 59 59 return \Closure::bind(function () use ($loader) { 60 $loader->prefixLengthsPsr4 = ComposerStaticInit a90277c3f4caff804b116f42616abbec::$prefixLengthsPsr4;61 $loader->prefixDirsPsr4 = ComposerStaticInit a90277c3f4caff804b116f42616abbec::$prefixDirsPsr4;62 $loader->classMap = ComposerStaticInit a90277c3f4caff804b116f42616abbec::$classMap;60 $loader->prefixLengthsPsr4 = ComposerStaticInit::$prefixLengthsPsr4; 61 $loader->prefixDirsPsr4 = ComposerStaticInit::$prefixDirsPsr4; 62 $loader->classMap = ComposerStaticInit::$classMap; 63 63 64 64 }, null, ClassLoader::class); -
wp-inci/trunk/blocks/product.php
r2851432 r2851529 61 61 62 62 /** 63 * Block product callback.64 *65 * @param array $fields Block fields.66 *67 * @return string68 */69 function wi_product_block_callback( $fields ) {70 71 $output = '<div class="block">72 <div class="block__product">73 <div class="wp-inci">';74 75 $start = '<h3>';76 $end = '</h3>';77 $title = esc_html( get_the_title( $fields['product'] ) );78 79 if ( isset( $fields['title'] ) && '' !== $fields['title'] ) {80 $title = esc_html( $fields['title'] );81 }82 83 if ( $fields['linked'] ) {84 $start = '<h3><a title="' . $title . '" href="' . get_permalink( $fields['product'] ) . '">';85 $end = '</a></h3>';86 }87 88 $output .= $start . $title . $end;89 90 $safety = 'true';91 92 if ( isset( $fields['safety'] ) && true === $fields['safety'] ) {93 $safety = 'false';94 }95 96 if ( ! $fields['list'] ) {97 $output .= ( Wp_Inci_Frontend::get_instanceFrontend() )->getIngredientsTable(98 $fields['product'],99 $safety100 );101 }102 $output .= '</div>103 </div>104 </div>';105 106 return $output;107 }108 109 /**110 63 * Register Product block. 111 64 * … … 132 85 ->set_category( 'wp-inci' ) 133 86 ->set_icon( 'wp-inci' ) 134 ->set_render_callback( wi_product_block_callback( Block::make()->get_fields() ) ); 87 // @codingStandardsIgnoreStart 88 ->set_render_callback( 89 function ( $fields, $attributes, $inner_blocks ) { 90 $output = '<div class="block"> 91 <div class="block__product"> 92 <div class="wp-inci">'; 93 94 $start = '<h3>'; 95 $end = '</h3>'; 96 $title = esc_html( get_the_title( $fields['product'] ) ); 97 98 if ( isset( $fields['title'] ) && '' !== $fields['title'] ) { 99 $title = esc_html( $fields['title'] ); 100 } 101 102 if ( $fields['linked'] ) { 103 $start = '<h3><a title="' . $title . '" href="' . get_permalink( $fields['product'] ) . '">'; 104 $end = '</a></h3>'; 105 } 106 107 $output .= $start . $title . $end; 108 109 $safety = 'true'; 110 111 if ( isset( $fields['safety'] ) && true === $fields['safety'] ) { 112 $safety = 'false'; 113 } 114 115 if ( ! $fields['list'] ) { 116 $output .= ( Wp_Inci_Frontend::get_instanceFrontend() )->getIngredientsTable( 117 $fields['product'], 118 $safety 119 ); 120 } 121 $output .= '</div> 122 </div> 123 </div>'; 124 125 echo $output; 126 } 127 // @codingStandardsIgnoreEnd 128 ); 135 129 } 136 130
Note: See TracChangeset
for help on using the changeset viewer.