Plugin Directory

Changeset 2851529

Timestamp:
01/19/2023 10:42:11 PM (19 months ago)
Author:
xlthlx
Message:

Version 1.6.1 fix

Location:
wp-inci
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wp-inci/tags/1.6.1/blocks/product.php

    r2851443 r2851529  
    6161
    6262/**
    63  * Block product callback.
    64  *
    65  * @param array $fields Block fields.
    66  *
    67  * @return string
    68  */
    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             $safety
    100         );
    101     }
    102     $output .= '</div>
    103         </div>
    104     </div>';
    105 
    106     return $output;
    107 }
    108 
    109 /**
    11063 * Register Product block.
    11164 *
     
    13285        ->set_category( 'wp-inci' )
    13386        ->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        );
    135129}
    136130
  • wp-inci/tags/1.6.1/vendor/autoload.php

    r2851449 r2851529  
    1010require_once __DIR__ . '/composer/autoload_real.php';
    1111
    12 return ComposerAutoloaderInita90277c3f4caff804b116f42616abbec::getLoader();
     12return ComposerAutoloaderInit::getLoader();
  • wp-inci/tags/1.6.1/vendor/composer/autoload_real.php

    r2851449 r2851529  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInita90277c3f4caff804b116f42616abbec
     5class ComposerAutoloaderInit
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInita90277c3f4caff804b116f42616abbec', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInita90277c3f4caff804b116f42616abbec', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInita90277c3f4caff804b116f42616abbec::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit::getInitializer($loader));
    3333
    3434        $loader->register(true);
    3535
    36         $includeFiles = \Composer\Autoload\ComposerStaticInita90277c3f4caff804b116f42616abbec::$files;
     36        $includeFiles = \Composer\Autoload\ComposerStaticInit::$files;
    3737        foreach ($includeFiles as $fileIdentifier => $file) {
    38             composerRequirea90277c3f4caff804b116f42616abbec($fileIdentifier, $file);
     38            composerRequire($fileIdentifier, $file);
    3939        }
    4040
     
    4848 * @return void
    4949 */
    50 function composerRequirea90277c3f4caff804b116f42616abbec($fileIdentifier, $file)
     50function composerRequire($fileIdentifier, $file)
    5151{
    5252    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • wp-inci/tags/1.6.1/vendor/composer/autoload_static.php

    r2851449 r2851529  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInita90277c3f4caff804b116f42616abbec
     7class ComposerStaticInit
    88{
    99    public static $files = array (
     
    5858    {
    5959        return \Closure::bind(function () use ($loader) {
    60             $loader->prefixLengthsPsr4 = ComposerStaticInita90277c3f4caff804b116f42616abbec::$prefixLengthsPsr4;
    61             $loader->prefixDirsPsr4 = ComposerStaticInita90277c3f4caff804b116f42616abbec::$prefixDirsPsr4;
    62             $loader->classMap = ComposerStaticInita90277c3f4caff804b116f42616abbec::$classMap;
     60            $loader->prefixLengthsPsr4 = ComposerStaticInit::$prefixLengthsPsr4;
     61            $loader->prefixDirsPsr4 = ComposerStaticInit::$prefixDirsPsr4;
     62            $loader->classMap = ComposerStaticInit::$classMap;
    6363
    6464        }, null, ClassLoader::class);
  • wp-inci/trunk/blocks/product.php

    r2851432 r2851529  
    6161
    6262/**
    63  * Block product callback.
    64  *
    65  * @param array $fields Block fields.
    66  *
    67  * @return string
    68  */
    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             $safety
    100         );
    101     }
    102     $output .= '</div>
    103         </div>
    104     </div>';
    105 
    106     return $output;
    107 }
    108 
    109 /**
    11063 * Register Product block.
    11164 *
     
    13285        ->set_category( 'wp-inci' )
    13386        ->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        );
    135129}
    136130
Note: See TracChangeset for help on using the changeset viewer.