本文整理汇总了PHP中wp_max_upload_size函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_max_upload_size函数的具体用法?PHP wp_max_upload_size怎么用?PHP wp_max_upload_size使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_max_upload_size函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: ac_gallery_get_upload_meta_data
function ac_gallery_get_upload_meta_data()
{
$plupload_init = array('runtimes' => 'html5,silverlight,flash,html4', 'browse_button' => 'plupload-browse-button', 'container' => 'plupload-upload-ui', 'drop_element' => 'drag-drop-area', 'file_data_name' => 'async-upload', 'multiple_queues' => true, 'max_file_size' => wp_max_upload_size() . 'b', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Allowed Files', 'alleycat'), 'extensions' => '*')), 'multipart' => true, 'urlstream_upload' => true, 'multipart_params' => array('_ajax_nonce' => wp_create_nonce('photo-upload'), 'action' => 'photo_gallery_upload'));
// Get the data values
$plupload_init = apply_filters('plupload_init', $plupload_init);
return $plupload_init;
}
开发者ID:Jhorton4,项目名称:Bohldfeys_Portfolio,代码行数:7,代码来源:dd-gallery-admin.php
示例2: __construct
/**
* Construct Upload parameters.
*
* @since 2.3.0
* @since 2.4.0 Add the $upload_dir_filter_args argument to the $arguments array
*
* @param array|string $args {
* @type int $original_max_filesize Maximum file size in kilobytes. Defaults to php.ini settings.
* @type array $allowed_mime_types List of allowed file extensions (eg: array( 'jpg', 'gif', 'png' ) ).
* Defaults to WordPress allowed mime types.
* @type string $base_dir Component's upload base directory. Defaults to WordPress 'uploads'.
* @type string $action The upload action used when uploading a file, $_POST['action'] must be set
* and its value must equal $action {@link wp_handle_upload()} (required).
* @type string $file_input The name attribute used in the file input. (required).
* @type array $upload_error_strings A list of specific error messages (optional).
* @type array $required_wp_files The list of required WordPress core files. Default: array( 'file' ).
* @type int $upload_dir_filter_args 1 to receive the original Upload dir array in the Upload dir filter, 0 otherwise.
* Defaults to 0 (optional).
* }
*/
public function __construct($args = '')
{
// Upload action and the file input name are required parameters.
if (empty($args['action']) || empty($args['file_input'])) {
return false;
}
// Sanitize the action ID and the file input name.
$this->action = sanitize_key($args['action']);
$this->file_input = sanitize_key($args['file_input']);
/**
* Max file size defaults to php ini settings or, in the case of
* a multisite config, the root site fileupload_maxk option
*/
$this->default_args['original_max_filesize'] = (int) wp_max_upload_size();
$params = bp_parse_args($args, $this->default_args, $this->action . '_upload_params');
foreach ($params as $key => $param) {
if ('upload_error_strings' === $key) {
$this->{$key} = $this->set_upload_error_strings($param);
// Sanitize the base dir.
} elseif ('base_dir' === $key) {
$this->{$key} = sanitize_title($param);
// Sanitize the upload dir filter arg to pass.
} elseif ('upload_dir_filter_args' === $key) {
$this->{$key} = (int) $param;
// Action & File input are already set and sanitized.
} elseif ('action' !== $key && 'file_input' !== $key) {
$this->{$key} = $param;
}
}
// Set the path/url and base dir for uploads.
$this->set_upload_dir();
}
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:52,代码来源:class-bp-attachment.php
示例3: displayForm
/**
* @param $action
* @param null $submitText
*/
public function displayForm($action, $submitText = null)
{
$bytes = wp_max_upload_size();
$size = size_format($bytes);
$upload_dir = IfwPsn_Wp_Proxy_Blog::getUploadDir();
if ($submitText == null) {
$submitText = __('Upload', 'ifw');
}
if (!empty($upload_dir['error'])) {
?>
<div class="error"><p><?php
_e('Before you can upload your import file, you will need to fix the following error:');
?>
</p>
<p><strong><?php
echo $upload_dir['error'];
?>
</strong></p></div><?php
} else {
$allowedExtensions = $this->getMimeTypes() != null ? implode(',', array_unique(array_keys($this->getMimeTypes()))) : null;
$label = sprintf('Choose a file from your computer (Maximum size: %s%s)', $size, $allowedExtensions !== null ? ', ' . __('allowed extensions: ') . $allowedExtensions : '');
?>
<form enctype="multipart/form-data" id="<?php
echo $this->_id;
?>
-upload-form" method="post" class="wp-upload-form" action="<?php
echo esc_url($action);
?>
">
<?php
echo wp_nonce_field($this->_getNonceName());
?>
<p>
<label for="upload-<?php
echo $this->_id;
?>
"><?php
echo $label;
?>
</label>
<input type="file" id="upload-<?php
echo $this->_id;
?>
" name="<?php
echo $this->_id;
?>
" size="25" />
<input type="hidden" name="action" value="upload" />
<input type="hidden" name="max_file_size" value="<?php
echo $bytes;
?>
" />
</p>
<?php
submit_button($submitText, 'button');
?>
</form>
<?php
}
}
开发者ID:jasmun,项目名称:Noco100,代码行数:64,代码来源:Upload.php
示例4: test_sync_callable_whitelist
public function test_sync_callable_whitelist()
{
// $this->setSyncClientDefaults();
$callables = array('wp_max_upload_size' => wp_max_upload_size(), 'is_main_network' => Jetpack::is_multi_network(), 'is_multi_site' => is_multisite(), 'main_network_site' => Jetpack_Sync_Functions::main_network_site_url(), 'single_user_site' => Jetpack::is_single_user_site(), 'updates' => Jetpack::get_updates(), 'home_url' => Jetpack_Sync_Functions::home_url(), 'site_url' => Jetpack_Sync_Functions::site_url(), 'has_file_system_write_access' => Jetpack_Sync_Functions::file_system_write_access(), 'is_version_controlled' => Jetpack_Sync_Functions::is_version_controlled(), 'taxonomies' => Jetpack_Sync_Functions::get_taxonomies(), 'post_types' => Jetpack_Sync_Functions::get_post_types(), 'post_type_features' => Jetpack_Sync_Functions::get_post_type_features(), 'rest_api_allowed_post_types' => Jetpack_Sync_Functions::rest_api_allowed_post_types(), 'rest_api_allowed_public_metadata' => Jetpack_Sync_Functions::rest_api_allowed_public_metadata(), 'sso_is_two_step_required' => Jetpack_SSO_Helpers::is_two_step_required(), 'sso_should_hide_login_form' => Jetpack_SSO_Helpers::should_hide_login_form(), 'sso_match_by_email' => Jetpack_SSO_Helpers::match_by_email(), 'sso_new_user_override' => Jetpack_SSO_Helpers::new_user_override(), 'sso_bypass_default_login_form' => Jetpack_SSO_Helpers::bypass_login_forward_wpcom(), 'wp_version' => Jetpack_Sync_Functions::wp_version(), 'get_plugins' => Jetpack_Sync_Functions::get_plugins(), 'active_modules' => Jetpack::get_active_modules(), 'hosting_provider' => Jetpack_Sync_Functions::get_hosting_provider(), 'locale' => get_locale(), 'site_icon_url' => Jetpack_Sync_Functions::site_icon_url());
if (is_multisite()) {
$callables['network_name'] = Jetpack::network_name();
$callables['network_allow_new_registrations'] = Jetpack::network_allow_new_registrations();
$callables['network_add_new_users'] = Jetpack::network_add_new_users();
$callables['network_site_upload_space'] = Jetpack::network_site_upload_space();
$callables['network_upload_file_types'] = Jetpack::network_upload_file_types();
$callables['network_enable_administration_menus'] = Jetpack::network_enable_administration_menus();
}
$this->sender->do_sync();
foreach ($callables as $name => $value) {
// TODO: figure out why _sometimes_ the 'support' value of
// the post_types value is being removed from the output
if ($name === 'post_types') {
continue;
}
$this->assertCallableIsSynced($name, $value);
}
$whitelist_keys = array_keys($this->callable_module->get_callable_whitelist());
$callables_keys = array_keys($callables);
// Are we testing all the callables in the defaults?
$whitelist_and_callable_keys_difference = array_diff($whitelist_keys, $callables_keys);
$this->assertTrue(empty($whitelist_and_callable_keys_difference), 'Some whitelisted options don\'t have a test: ' . print_r($whitelist_and_callable_keys_difference, 1));
// Are there any duplicate keys?
$unique_whitelist = array_unique($whitelist_keys);
$this->assertEquals(count($unique_whitelist), count($whitelist_keys), 'The duplicate keys are: ' . print_r(array_diff_key($whitelist_keys, array_unique($whitelist_keys)), 1));
}
开发者ID:automattic,项目名称:jetpack,代码行数:30,代码来源:test_class.jetpack-sync-callables.php
示例5: respond_to_get_remote_media_info
/**
* Return information about remote site for use in media migration
*
* @return bool|null
*/
public function respond_to_get_remote_media_info()
{
add_filter('wpmdb_before_response', array($this, 'scramble'));
$key_rules = array('action' => 'key', 'remote_state_id' => 'key', 'intent' => 'key', 'sig' => 'string');
$this->set_post_data($key_rules, 'remote_state_id');
$filtered_post = $this->filter_post_elements($this->state_data, array('action', 'remote_state_id', 'intent'));
if (!$this->verify_signature($filtered_post, $this->settings['key'])) {
$return = array('wpmdb_error' => 1, 'body' => $this->invalid_content_verification_error . ' (#100mf)');
$this->log_error($return['body'], $filtered_post);
$result = $this->end_ajax(serialize($return));
return $result;
}
if (defined('UPLOADBLOGSDIR')) {
$upload_url = home_url(UPLOADBLOGSDIR);
} else {
$upload_dir = wp_upload_dir();
$upload_url = $upload_dir['baseurl'];
if (is_multisite()) {
// Remove multisite postfix
$upload_url = preg_replace('/\\/sites\\/(\\d)+$/', '', $upload_url);
}
}
$return['remote_total_attachments'] = $this->get_local_attachments_count();
$return['remote_uploads_url'] = $upload_url;
$return['blogs'] = serialize($this->get_blogs());
$return['remote_max_upload_size'] = wp_max_upload_size();
$result = $this->end_ajax(serialize($return));
return $result;
}
开发者ID:Garth619,项目名称:wines-by-jennifer,代码行数:34,代码来源:wpmdbpro-media-files-remote.php
示例6: iced_mocha_import_form
/**
* This file manages the theme settings uploading and import operations.
* Uses the theme page to create a new form for uplaoding the settings
* Uses WP_Filesystem
*/
function iced_mocha_import_form()
{
$bytes = apply_filters('import_upload_size_limit', wp_max_upload_size());
$size = wp_convert_bytes_to_hr($bytes);
$upload_dir = wp_upload_dir();
if (!empty($upload_dir['error'])) {
?>
<div class="error"><p><?php
_e('Before you can upload your import file, you will need to fix the following error:', 'iced_mocha');
?>
</p>
<p><strong><?php
echo $upload_dir['error'];
?>
</strong></p></div><?php
} else {
?>
<div class="wrap">
<div style="width:400px;display:block;margin-left:30px;">
<div id="icon-tools" class="icon32"><br></div>
<h2><?php
echo __('Import Iced Mocha Options', 'iced_mocha');
?>
</h2>
<form enctype="multipart/form-data" id="import-upload-form" method="post" action="">
<p><?php
_e('Hi! This is where you import the Iced Mocha Theme settings.<i> Please remember that this is still an experimental feature.</i>', 'iced_mocha');
?>
</p>
<p>
<label for="upload"><strong><?php
_e('Just choose a file from your computer:', 'iced_mocha');
?>
</strong><i>(iced_mocha-settings.txt)</i></label>
<input type="file" id="upload" name="import" size="25" />
<span style="font-size:10px;">(<?php
printf(__('Maximum size: %s', 'iced_mocha'), $size);
?>
)</span>
<input type="hidden" name="action" value="save" />
<input type="hidden" name="max_file_size" value="<?php
echo $bytes;
?>
" />
<?php
wp_nonce_field('iced_mocha-import', 'iced_mocha-import');
?>
<input type="hidden" name="iced_mocha_import_confirmed" value="true" />
</p>
<input type="submit" class="button" value="<?php
_e('And import!', 'iced_mocha');
?>
" />
</form>
</div>
</div> <!-- end wrap -->
<?php
}
}
开发者ID:JBNavadiya,项目名称:iced-mocha,代码行数:65,代码来源:admin-functions.php
示例7: get_max_upload
function get_max_upload()
{
if (function_exists('wp_max_upload_size')) {
return wp_max_upload_size();
} else {
return ini_get('upload_max_filesize') . 'b';
}
}
开发者ID:yarylo,项目名称:cerkva.pp.ua,代码行数:8,代码来源:resize-images-before-upload.php
示例8: getSections
/**
* @return array List of items to display.
*/
public function getSections()
{
if (empty($this->sections)) {
$this->sections = array(array('title' => __('Get System Information', 'jigoshop'), 'id' => 'get-system-information', 'description' => __('Please copy and paste this information in your ticket when contacting support', 'jigoshop'), 'fields' => array(array('id' => 'debug_report', 'title' => '', 'generate_button_id' => 'generate-report', 'debug_textarea_id' => 'report-for-support', 'generate_button_label' => __('Generate Report', 'jigoshop'), 'type' => 'user_defined', 'display' => function ($field) {
return Render::output('admin/system_info/debug_report', $field);
}))), array('title' => __('WordPress Environment', 'jigoshop'), 'id' => 'wordpress-environment', 'fields' => array(array('id' => 'home-url', 'name' => 'home-url', 'title' => __('Home URL', 'jigoshop'), 'tip' => __('The URL of your site\'s homepage.', 'jigoshop'), 'type' => 'constant', 'value' => home_url()), array('id' => 'site-url', 'name' => 'site-url', 'title' => __('Site URL', 'jigoshop'), 'tip' => __('The root URL of your site.', 'jigoshop'), 'type' => 'constant', 'value' => site_url()), array('id' => 'jigoshop-version', 'name' => 'jigoshop-version', 'title' => __('Jigoshop Version', 'jigoshop'), 'tip' => __('The version of Jigoshop installed on your site.', 'jigoshop'), 'type' => 'constant', 'value' => Core::VERSION), array('id' => 'jigoshop-database-version', 'name' => 'jigoshop-database-version', 'title' => __('Jigoshop Database Version', 'jigoshop'), 'tip' => __('The version of jigoshop that the database is formatted for. This should be the same as your jigoshop Version.', 'jigoshop'), 'type' => 'constant', 'value' => $this->wp->getOption('jigoshop-database-version')), array('id' => 'log-directory-writable', 'name' => 'log-directory-writable', 'title' => __('Log Directory Writable', 'jigoshop'), 'tip' => __('Several Jigoshop extensions can write logs which makes debugging problems easier. The directory must be writable for this to happen.', 'jigoshop'), 'description' => sprintf(__('To allow logging, make <code>%s</code> writable or define a custom <code>JIGOSHOP_LOG_DIR</code>.', 'jigoshop'), JIGOSHOP_LOG_DIR), 'type' => 'constant', 'value' => $this->checkLogDirectory() ? $this->yes : $this->no), array('id' => 'wp-version', 'name' => 'wp-version', 'title' => __('WP Version', 'jigoshop'), 'tip' => __('The version of WordPress installed on your site.', 'jigoshop'), 'type' => 'constant', 'value' => get_bloginfo('version')), array('id' => 'wp-multisite', 'name' => 'wp-multisite', 'title' => __('WP Multisite', 'jigoshop'), 'tip' => __('The maximum amount of memory (RAM) that your site can use at one time.', 'jigoshop'), 'type' => 'constant', 'value' => is_multisite() ? $this->yes : $this->no), array('id' => 'wp-memory-limit', 'name' => 'wp-memory-limit', 'title' => __('WP Memory Limit', 'jigoshop'), 'tip' => __('The maximum amount of memory (RAM) that your site can use at one time.', 'jigoshop'), 'type' => 'constant', 'value' => $this->checkMemoryLimit(WP_MEMORY_LIMIT, JIGOSHOP_REQUIRED_WP_MEMORY)), array('id' => 'wp-debug-mode', 'name' => 'wp-debug-mode', 'title' => __('WP Debug Mode', 'jigoshop'), 'tip' => __('Displays whether or not WordPress is in Debug Mode.', 'jigoshop'), 'type' => 'constant', 'value' => defined('WP_DEBUG') && WP_DEBUG ? $this->yes : $this->no), array('id' => 'language', 'name' => 'language', 'title' => __('Language', 'jigoshop'), 'tip' => __('The current language used by WordPress. Default = English.', 'jigoshop'), 'type' => 'constant', 'value' => get_locale()))), array('title' => __('Server Environment', 'jigoshop'), 'id' => 'srever-environment', 'fields' => array(array('id' => 'server-info', 'name' => 'server-info', 'title' => __('Server Info', 'jigoshop'), 'tip' => __('Information about the web server that is currently hosting your site.', 'jigoshop'), 'type' => 'constant', 'value' => esc_html($_SERVER['SERVER_SOFTWARE'])), array('id' => 'php-version', 'name' => 'php-version', 'title' => __('PHP Version', 'jigoshop'), 'tip' => __('The version of PHP installed on your hosting server.', 'jigoshop'), 'type' => 'constant', 'value' => $this->checkPhpVersion(PHP_VERSION, JIGOSHOP_PHP_VERSION)), array('id' => 'php-post-max-size', 'name' => 'php-post-max-size', 'title' => __('PHP Post Max Size', 'jigoshop'), 'tip' => __('The largest filesize that can be contained in one post.', 'jigoshop'), 'type' => 'constant', 'value' => size_format($this->letterToNumber($this->iniGet('post_max_size')))), array('id' => 'php-time-limit', 'name' => 'php-time-limit', 'title' => __('PHP Time Limit', 'jigoshop'), 'tip' => __('The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups).', 'jigoshop'), 'type' => 'constant', 'value' => size_format($this->letterToNumber($this->iniGet('post_max_size')))), array('id' => 'php-time-limit', 'name' => 'php-time-limit', 'title' => __('PHP Max Input Vars', 'jigoshop'), 'tip' => __('The maximum number of variables your server can use for a single function to avoid overloads.', 'jigoshop'), 'type' => 'constant', 'value' => $this->iniGet('max_input_vars')), array('id' => 'suhosin-installed', 'name' => 'suhosin-installed', 'title' => __('SUHOSIN Installed', 'jigoshop'), 'tip' => __('Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'jigoshop'), 'type' => 'constant', 'value' => extension_loaded('suhosin') ? $this->yes : $this->no), array('id' => 'eaccelerator', 'name' => 'eaccelerator', 'title' => __('eAccelerator', 'jigoshop'), 'classes' => array('system-data'), 'tip' => __('eAccelerator is deprecated and causes problems with Jigoshop.', 'jigoshop'), 'type' => 'constant', 'value' => $this->iniGet('eaccelerator.enable') == 1 ? $this->yes : $this->no), array('id' => 'apc', 'name' => 'apc', 'title' => __('APC', 'jigoshop'), 'tip' => __('APC is deprecated and causes problems with Jigoshop.', 'jigoshop'), 'type' => 'constant', 'value' => $this->iniGet('apc.enable') == 1 ? $this->yes : $this->no), array('id' => 'apc', 'name' => 'apc', 'title' => __('OpCache', 'jigoshop'), 'tip' => __('OpCache is new PHP optimizer and it is recommended to use with Jigoshop.', 'jigoshop'), 'type' => 'constant', 'value' => $this->iniGet('opcache.enable') == 1 ? $this->yes : $this->no), array('id' => 'short-open-tag', 'name' => 'short-open-tag', 'title' => __('Short Open Tag', 'jigoshop'), 'tip' => __('Whether short tags are enabled, they are used by some older extensions.', 'jigoshop'), 'type' => 'constant', 'value' => $this->iniGet('short-open-tag') != '' ? $this->yes : $this->no), array('id' => 'allow-url-fopen', 'name' => 'allow-url-fopen', 'title' => __('Allow URL fopen', 'jigoshop'), 'tip' => __('Whether fetching remote files is allowed. This option is used by many Jigoshop extensions.', 'jigoshop'), 'type' => 'constant', 'value' => $this->iniGet('allow_url_fopen') != '' ? $this->yes : $this->no), array('id' => 'session', 'name' => 'session', 'title' => __('Session', 'jigoshop'), 'tip' => __('Whether fetching remote files is allowed. This option is used by many Jigoshop extensions.', 'jigoshop'), 'type' => 'constant', 'value' => session_id() != null && isset($_SESSION) ? $this->yes : $this->no), array('id' => 'cookie-path', 'name' => 'cookie-path', 'title' => __('Cookie Path', 'jigoshop'), 'tip' => __('Path for which cookies are saved. This is important for sessions and session security.', 'jigoshop'), 'type' => 'constant', 'value' => $this->iniGet('session.cookie_path')), array('id' => 'save-path', 'name' => 'save-path', 'title' => __('Save Path', 'jigoshop'), 'tip' => __('Path where sessions are stored on the server. This is sometimes cause of login/logout problems.', 'jigoshop'), 'type' => 'constant', 'value' => esc_html($this->iniGet('session.save_path'))), array('id' => 'use-cookies', 'name' => 'use-cookies', 'title' => __('Use Cookies', 'jigoshop'), 'tip' => __('Whether cookies are used to store PHP session on user\'s computer. Recommended.', 'jigoshop'), 'type' => 'constant', 'value' => $this->iniGet('session.use_cookies') != '' ? $this->yes : $this->no), array('id' => 'use-only-cookies', 'name' => 'use-only-cookies', 'title' => __('Use Only Cookies', 'jigoshop'), 'tip' => __('Whether PHP uses only cookies to handle user sessions. This is important for security reasons.', 'jigoshop'), 'type' => 'constant', 'value' => $this->iniGet('session.use_only_cookies') != '' ? $this->yes : $this->no), array('id' => 'max-upload-size', 'name' => 'max-upload-size', 'title' => __('Max Upload Size', 'jigoshop'), 'tip' => __('The largest filesize that can be uploaded to your WordPress installation.', 'jigoshop'), 'type' => 'constant', 'value' => size_format(wp_max_upload_size())), array('id' => 'default-timezone', 'name' => 'default-timezone', 'title' => __('Default Timezone', 'jigoshop'), 'tip' => __('The default timezone for your server. We recommend to set it as UTC.', 'jigoshop'), 'type' => 'constant', 'value' => date_default_timezone_get()), array('id' => 'fsockopen-curl', 'name' => 'fsockopen-curl', 'title' => __('fsockopen/cURL', 'jigoshop'), 'tip' => __('Payment gateways can use cURL to communicate with remote servers to authorize payments, other plugins may also use it when communicating with remote services.', 'jigoshop'), 'type' => 'constant', 'value' => function_exists('fsockopen') || function_exists('curl_init') ? $this->yes : $this->no), array('id' => 'soap-client', 'name' => 'soap-client', 'title' => __('SoapClient', 'jigoshop'), 'tip' => __('Some webservices like shipping use SOAP to get information from remote servers, for example, live shipping quotes from FedEx require SOAP to be installed.', 'jigoshop'), 'type' => 'constant', 'value' => class_exists('SoapClient') ? $this->yes : $this->no), array('id' => 'wp-remote-post', 'name' => 'wp-remote-post', 'title' => __('Remote Post', 'jigoshop'), 'tip' => __('PayPal uses this method of communicating when sending back transaction information.', 'jigoshop'), 'type' => 'constant', 'value' => $this->checkRemoteRequest('post') ? $this->yes : $this->no), array('id' => 'wp-remote-get', 'name' => 'wp-remote-get', 'title' => __('Remote Get', 'jigoshop'), 'tip' => __('PayJigoshop plugins may use this method of communication when checking for plugin updates.', 'jigoshop'), 'type' => 'constant', 'value' => $this->checkRemoteRequest('get') ? $this->yes : $this->no))), array('title' => __('Server Locale', 'jigoshop'), 'id' => 'srever-locale', 'fields' => array(array('id' => 'decimal-point', 'name' => 'decimal-point', 'title' => __('Decimal Point', 'jigoshop'), 'tip' => __('The character used for decimal points.', 'jigoshop'), 'type' => 'constant', 'value' => $this->getServerLocale('decimal_point') ? $this->getServerLocale('decimal_point') : $this->no), array('id' => 'thousands-sep', 'name' => 'thousands-sep', 'title' => __('Thousands Separator', 'jigoshop'), 'tip' => __('The character used for a thousands separator.', 'jigoshop'), 'type' => 'constant', 'value' => $this->getServerLocale('thousands_sep') ? $this->getServerLocale('thousands_sep') : $this->no), array('id' => 'mon-decimal-point', 'name' => 'mon-decimal-point', 'title' => __('Monetary Decimal Point', 'jigoshop'), 'tip' => __('The character used for decimal points in monetary values.', 'jigoshop'), 'type' => 'constant', 'value' => $this->getServerLocale('mon_decimal_point') ? $this->getServerLocale('mon_decimal_point') : $this->no), array('id' => 'mon-thousands-sep', 'name' => 'mon-thousands-sep', 'title' => __('Monetary Thousands Separator', 'jigoshop'), 'tip' => __('The character used for a thousands separator in monetary values.', 'jigoshop'), 'type' => 'constant', 'value' => $this->getServerLocale('mon_thousands_sep') ? $this->getServerLocale('mon_thousands_sep') : $this->no))), array('title' => sprintf(__('Active Plugins (%s)', 'jigoshop'), count((array) $this->wp->getOption('active_plugins'))), 'id' => 'active-plugins', 'fields' => $this->getActivePlugins()), array('title' => __('Settings', 'jigoshop'), 'id' => 'settings', 'fields' => array(array('id' => 'force-ssl', 'name' => 'force-ssl', 'title' => __('Force SSL', 'jigoshop'), 'tip' => __('Does your site force a SSL Certificate for transactions?', 'jigoshop'), 'type' => 'constant', 'value' => $this->options->get('shopping.force_ssl') ? $this->yes : $this->no), array('id' => 'shipping-enabled', 'name' => 'shipping-enabled', 'title' => __('Shipping Enabled', 'jigoshop'), 'tip' => __('Does your site have shipping enabled?', 'jigoshop'), 'type' => 'constant', 'value' => $this->options->get('shipping.enabled') ? $this->yes : $this->no), array('id' => 'currency', 'name' => 'currency', 'title' => __('Shipping Enabled', 'jigoshop'), 'tip' => __('What currency prices are listed at in the catalog and which currency gateways will take payments in?', 'jigoshop'), 'type' => 'constant', 'value' => Currency::code() . '(' . Currency::symbol() . ')'), array('id' => 'currency-position', 'name' => 'currency-position', 'title' => __('Currency Position', 'jigoshop'), 'tip' => __('The position of the currency symbol.', 'jigoshop'), 'type' => 'constant', 'value' => $this->getCurrencyPosition()), array('id' => 'thousand-separator', 'name' => 'thousand-separator', 'title' => __('Thousand Separator', 'jigoshop'), 'tip' => __('The thousand separator of displayed prices.', 'jigoshop'), 'type' => 'constant', 'value' => $this->options->get('general.currency_thousand_separator')), array('id' => 'decimal-separator', 'name' => 'decimal-separator', 'title' => __('Decimal Separator', 'jigoshop'), 'tip' => __('The decimal separator of displayed prices.', 'jigoshop'), 'type' => 'constant', 'value' => $this->options->get('general.currency_decimal_separator')), array('id' => 'number-of-decimals', 'name' => 'number-of-decimals', 'title' => __('Number of Decimals', 'jigoshop'), 'tip' => __('The number of decimal points shown in displayed prices.', 'jigoshop'), 'type' => 'constant', 'value' => $this->options->get('general.currency_decimals')))), array('title' => __('Jigoshop Pages', 'jigoshop'), 'id' => 'jigoshop-pages', 'fields' => array(array('id' => 'shop-base', 'name' => 'shop-base', 'title' => __('Shop Base', 'jigoshop'), 'tip' => __('The ID of your Jigoshop shop\'s homepage.', 'jigoshop'), 'type' => 'constant', 'value' => $this->options->get('advanced.pages.shop') ? '#' . $this->options->get('advanced.pages.shop') : $this->no), array('id' => 'cart', 'name' => 'cart', 'title' => __('Cart', 'jigoshop'), 'tip' => __('The ID of your Jigoshop shop\'s cart page.', 'jigoshop'), 'type' => 'constant', 'value' => $this->options->get('advanced.pages.cart') ? '#' . $this->options->get('advanced.pages.cart') : $this->no), array('id' => 'checkout', 'name' => 'checkout', 'title' => __('Checkout', 'jigoshop'), 'tip' => __('The ID of your Jigoshop shop\'s checkout page.', 'jigoshop'), 'type' => 'constant', 'value' => $this->options->get('advanced.pages.checkout') ? '#' . $this->options->get('advanced.pages.checkout') : $this->no), array('id' => 'thank-you', 'name' => 'thank-you', 'title' => __('Thank You', 'jigoshop'), 'tip' => __('The ID of your Jigoshop shop\'s thank you page.', 'jigoshop'), 'type' => 'constant', 'value' => $this->options->get('advanced.pages.checkout_thank_you') ? '#' . $this->options->get('advanced.pages.checkout_thank_you') : $this->no), array('id' => 'my-account', 'name' => 'my-account', 'title' => __('My account', 'jigoshop'), 'tip' => __('The ID of your Jigoshop shop\'s my account page.', 'jigoshop'), 'type' => 'constant', 'value' => $this->options->get('advanced.pages.account') ? '#' . $this->options->get('advanced.pages.account') : $this->no), array('id' => 'terms', 'name' => 'terms', 'title' => __('Terms', 'jigoshop'), 'tip' => __('The ID of your Jigoshop shop\'s terms page.', 'jigoshop'), 'type' => 'constant', 'value' => $this->options->get('advanced.pages.terms') ? '#' . $this->options->get('advanced.pages.terms') : $this->no))), array('title' => __('Theme', 'jigoshop'), 'id' => 'theme', 'fields' => array(array('id' => 'name', 'name' => 'name', 'title' => __('Name', 'jigoshop'), 'tip' => __('The name of the current active theme.', 'jigoshop'), 'type' => 'constant', 'value' => $this->wp->wpGetTheme()->display('Name')), array('id' => 'version', 'name' => 'version', 'title' => __('Version', 'jigoshop'), 'tip' => __('The installed version of the current active theme.', 'jigoshop'), 'type' => 'constant', 'value' => $this->wp->wpGetTheme()->display('Version')), array('id' => 'author-url', 'name' => 'author-url', 'title' => __('Author URL', 'jigoshop'), 'tip' => __('The theme developers URL.', 'jigoshop'), 'type' => 'constant', 'value' => $this->wp->wpGetTheme()->display('AuthorURI')), array('id' => 'child-theme', 'name' => 'child-theme', 'title' => __('Child Theme', 'jigoshop'), 'tip' => __('Displays whether or not the current theme is a child theme', 'jigoshop'), 'description' => sprintf(__('If you\'re modifying Jigoshop or a parent theme you didn\'t build personally we recommend using a child theme. See: <a href="%s" target="-blank">How to create a child theme</a>', 'jigoshop'), 'https://codex.wordpress.org/Child_Themes'), 'type' => 'constant', 'value' => is_child_theme() ? $this->yes : $this->no), array('id' => 'parent-theme-name', 'name' => 'parent-theme-name', 'title' => __('Parent Theme Name', 'jigoshop'), 'tip' => __('The name of the parent theme.', 'jigoshop'), 'type' => 'constant', 'value' => is_child_theme() ? wp_get_theme($this->wp->wpGetTheme()->display('Template'))->display('Name') : $this->no), array('id' => 'parent-theme-version', 'name' => 'parent-theme-version', 'title' => __('Parent Theme Version', 'jigoshop'), 'tip' => __('The installed version of the parent theme.', 'jigoshop'), 'type' => 'constant', 'value' => is_child_theme() ? wp_get_theme($this->wp->wpGetTheme()->display('Template'))->display('Version') : $this->no), array('id' => 'parent-theme-author-url', 'name' => 'parent-theme-author-url', 'title' => __('Parent Theme Author URL', 'jigoshop'), 'tip' => __('The installed version of the parent theme.', 'jigoshop'), 'type' => 'constant', 'value' => is_child_theme() ? wp_get_theme($this->wp->wpGetTheme()->display('Template'))->display('AuthorURI') : $this->no))), array('title' => __('Templates', 'jigoshop'), 'id' => 'templates', 'description' => __('This section shows any files that are overriding the default jigoshop template pages', 'jigoshop'), 'fields' => $this->getOverrides()));
}
return $this->sections;
}
开发者ID:jigoshop,项目名称:Jigoshop2,代码行数:12,代码来源:SystemStatusTab.php
示例9: get_maximum_upload_file_size_bytes
/**
* Returns the maximum upload file size in bytes
*
* @param string $size Human readable size
*
* @return int Maximum upload file size
*/
public function get_maximum_upload_file_size_bytes($size)
{
$converter_utility = $this->_registry->get('size.converter');
$maximum_size = $converter_utility->convert_hr_to_bytes($size);
if ($maximum_size <= 0 || $maximum_size > wp_max_upload_size()) {
$maximum_size = wp_max_upload_size();
}
return $maximum_size;
}
开发者ID:AndreyLanko,项目名称:perevorot-prozorro-wp,代码行数:16,代码来源:size-determiner.php
示例10: admin_enqueue_scripts
/**
* Enqueue scripts and styles
*
* @return void
*/
static function admin_enqueue_scripts()
{
// Enqueue same scripts and styles as for file field
parent::admin_enqueue_scripts();
wp_enqueue_style('rwmb-plupload-image', RWMB_CSS_URL . 'plupload-image.css', array('wp-admin'), RWMB_VER);
wp_enqueue_script('rwmb-plupload-image', RWMB_JS_URL . 'plupload-image.js', array('jquery-ui-sortable', 'wp-ajax-response', 'plupload-all'), RWMB_VER, true);
wp_localize_script('rwmb-plupload-image', 'RWMB', array('url' => RWMB_URL));
wp_localize_script('rwmb-plupload-image', 'rwmb_plupload_defaults', array('runtimes' => 'html5,silverlight,flash,html4', 'file_data_name' => 'async-upload', 'multiple_queues' => true, 'max_file_size' => wp_max_upload_size() . 'b', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => _x('Allowed Image Files', 'image upload', 'rwmb'), 'extensions' => 'jpg,jpeg,gif,png')), 'multipart' => true, 'urlstream_upload' => true));
}
开发者ID:James-Driscoll,项目名称:ColinSandersPhotography,代码行数:14,代码来源:plupload-image.php
示例11: initScripts
public function initScripts($page)
{
if (!$this->enqueueCheck($page)) {
return;
}
wp_enqueue_script('wpforms-plupload-setup', $this->getBaseUrl() . '/assets/js/plupload-setup.min.js', array('jquery', 'plupload-all'), false, true);
wp_enqueue_style('wpforms-plupload', $this->getBaseUrl() . '/assets/css/plupload.css');
self::$params[$this->attributes['id']] = array('runtimes' => 'html5,silverlight,flash,html4', 'browse_button' => $this->attributes['browse_button'], 'container' => $this->attributes['container'], 'drop_element' => $this->attributes['drop_element'], 'file_data_name' => $this->attributes['file_data_name'], 'preview_thumb_id' => $this->attributes['preview_thumb_id'], 'multiple_queues' => false, 'max_file_size' => wp_max_upload_size() . 'b', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Allowed Files', 'wpforms'), 'extensions' => '*')), 'multipart' => true, 'urlstream_upload' => true, 'multipart_params' => array('_ajax_nonce' => wp_create_nonce($this->attributes['ajax_action']), 'action' => $this->attributes['ajax_action']));
}
开发者ID:loumray,项目名称:wpforms,代码行数:9,代码来源:UploadImage.php
示例12: get_plupload_options
function get_plupload_options()
{
$retval = array();
$retval['runtimes'] = 'gears,browserplus,html5,flash,silverlight,html4';
$retval['max_file_size'] = strval(round((int) wp_max_upload_size() / 1024)) . 'kb';
$retval['filters'] = $this->object->get_plupload_filters();
$retval['flash_swf_url'] = includes_url('js/plupload/plupload.flash.swf');
$retval['silverlight_xap_url'] = includes_url('js/plupload/plupload.silverlight.xap');
$retval['debug'] = TRUE;
return $retval;
}
开发者ID:lcw07r,项目名称:productcampamsterdam.org,代码行数:11,代码来源:adapter.upload_images_form.php
示例13: wp_limit
public function wp_limit()
{
$output = wp_max_upload_size();
$output = round($output);
$output = $output / 1000000;
//convert to megabytes
$output = round($output);
$output = $output * 1000;
// convert to kilobytes
return $output;
}
开发者ID:jagarciavi,项目名称:jagarciavi_me_1,代码行数:11,代码来源:wp-image-size-limit.php
示例14: inner_custom_box
public function inner_custom_box($post)
{
$gallery = get_post_meta($post->ID, 'wpsimplegallery_gallery', true);
wp_nonce_field(basename(__FILE__), 'wpsimplegallery_gallery_nonce');
$upload_size_unit = $max_upload_size = wp_max_upload_size();
$sizes = array('KB', 'MB', 'GB');
for ($u = -1; $upload_size_unit > 1024 && $u < count($sizes) - 1; $u++) {
$upload_size_unit /= 1024;
}
if ($u < 0) {
$upload_size_unit = 0;
$u = 0;
} else {
$upload_size_unit = (int) $upload_size_unit;
}
$upload_action_url = admin_url('async-upload.php');
$post_params = array("post_id" => $post->ID, "_wpnonce" => wp_create_nonce('media-form'), "short" => "1");
$post_params = apply_filters('upload_post_params', $post_params);
// hook change! old name: 'swfupload_post_params'
$plupload_init = array('runtimes' => 'html5,silverlight,flash,html4', 'browse_button' => 'wpsg-plupload-browse-button', 'file_data_name' => 'async-upload', 'multiple_queues' => true, 'max_file_size' => $max_upload_size . 'b', 'url' => $upload_action_url, 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Allowed Files', THEMEDOMAIN), 'extensions' => '*')), 'multipart' => true, 'urlstream_upload' => true, 'multipart_params' => $post_params);
?>
<script type="text/javascript">
var POST_ID = <?php
echo $post->ID;
?>
;
var WPSGwpUploaderInit = <?php
echo json_encode($plupload_init);
?>
;
</script>
<span class="spinner" id="wpsimplegallyer_spinner"></span>
<div id="wpsimplegallery_container">
<ul id="wpsimplegallery_thumbs" class="clearfix"><?php
$gallery = is_string($gallery) ? @unserialize($gallery) : $gallery;
if (is_array($gallery) && count($gallery) > 0) {
foreach ($gallery as $id) {
echo $this->admin_thumb($id);
}
}
?>
</ul>
</div>
<input id="wpsimplegallery_upload_button" data-uploader_title="Upload Image" data-uploader_button_text="Select" style="margin-bottom:8px" class="primary_button button" type="button" value="<?php
echo __('Upload Image', 'wpsimplegallery');
?>
" rel="" />
<input id="wpsimplegallery_delete_all_button" class="button secondary_button" type="button" style="margin-bottom:8px" value="<?php
echo __('Delete All Images', 'wpsimplegallery');
?>
" rel="" />
<?php
}
开发者ID:shrtbbbl,项目名称:happyhoppy,代码行数:54,代码来源:tg-gallery.php
示例15: hf_load_custom_script
function hf_load_custom_script()
{
global $post;
global $page;
$show_frontendpost = zl_option('show_frontendpost');
if (is_user_logged_in() && !is_singular() && $show_frontendpost == 1) {
wp_enqueue_script('rw-uploader', get_template_directory_uri() . '/lib/js/pl.uploader.js', array('jquery'), '1.0.0', true);
$plupload_init = array('runtimes' => 'html5,silverlight,flash,html4', 'browse_button' => 'plupload-browse-button', 'container' => 'gallery', 'drop_element' => 'rw-drag-drop', 'file_data_name' => 'async-upload', 'multiple_queues' => true, 'max_file_size' => wp_max_upload_size() . 'b', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => zl_option('lang_allowedfiles', __('Allowed Files', 'zatolab')), 'extensions' => 'jpg,gif,png')), 'multipart' => true, 'urlstream_upload' => true, 'multi_selection' => false, 'multipart_params' => array('_ajax_nonce' => '', 'action' => 'photo_gallery_upload', 'imgid' => 0));
$plupload_init = apply_filters('rw_uploader_init', $plupload_init);
wp_localize_script('rw-uploader', 'rwUploaderInit', $
|
请发表评论