Как создать сниппет
-
В файле /wp-admin/includes/file.php присутствует такой код
/** * Filters the override parameters for a file before it is uploaded to WordPress. * * The dynamic portion of the hook name, <code>$action</code>, refers to the post action. * * Possible hook names include: * * - <code>wp_handle_sideload_overrides</code> * - <code>wp_handle_upload_overrides</code> * * @since 5.7.0 * * @param array|false $overrides An array of override parameters for this file. Boolean false if none are * provided. @see _wp_handle_upload(). * @param string[] $file An array of data for the file. Reference to a single element of <code>$_FILES</code>. */ $overrides = apply_filters( "{$action}_overrides", $overrides, $file );
Далее пропускаем
Вот строка кода, который не позволяет импортировать товар встроенным инструментом импорта-экспорта в режиме мультисайта return call_user_func_array( $upload_error_handler, array( &$file, __( ‘Sorry, this file type is not permitted for security reasons.’ ) ) );.if ( ( ! $type || ! $ext ) && ! current_user_can( 'unfiltered_upload' ) ) { return call_user_func_array( $upload_error_handler, array( &$file, __( 'Sorry, this file type is not permitted for security reasons.' ) ) ); }
Подскажите пожалуйста, как будет выглядеть сниппет который закомментирует строку выдающую ошибку в варианте мультисайта.
// return call_user_func_array( $upload_error_handler, array( &$file, __( 'Sorry, this file type is not permitted for security reasons.' ) ) );
Уважаемые профессионалы, прошу поддержки. Можно непосредственно код сниппета. Можно и ссылочку на документацию (владею только русским) в которой описано как сделать такого рода сниппет.
Просмотр 6 ответов — с 1 по 6 (всего 6)
Просмотр 6 ответов — с 1 по 6 (всего 6)
- Тема «Как создать сниппет» закрыта для новых ответов.