Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move hybrid_image_size_names_choose() from utility.php to media.php.

git-svn-id: http://svn.locallylost.com/themes/hybrid-core/trunk@1007 dba0f204-706d-4bc1-bc29-8b92e0485636
  • Loading branch information...
commit 7a19f14537ecd71ae8c83134d343b3ee14e5ec0f 1 parent b89cc5d
greenshady authored
Showing with 29 additions and 29 deletions.
  1. +29 −0 functions/media.php
  2. +0 −29 functions/utility.php
View
29 functions/media.php
@@ -20,6 +20,9 @@
/* Load the development stylsheet in script debug mode. */
add_filter( 'stylesheet_uri', 'hybrid_debug_stylesheet', 10, 2 );
+/* Add all image sizes to the image editor to insert into post. */
+add_filter( 'image_size_names_choose', 'hybrid_image_size_names_choose' );
+
/**
* Registers JavaScript files for the framework. This function merely registers scripts with WordPress using
* the wp_register_script() function. It does not load any script files on the site. If a theme wants to register
@@ -94,6 +97,32 @@ function hybrid_debug_stylesheet( $stylesheet_uri, $stylesheet_dir_uri ) {
}
/**
+ * Adds theme/plugin custom images sizes added with add_image_size() to the image uploader/editor. This
+ * allows users to insert these images within their post content editor.
+ *
+ * @since 1.3.0
+ * @access private
+ * @param array $sizes Selectable image sizes.
+ * @return array $sizes
+ */
+function hybrid_image_size_names_choose( $sizes ) {
+
+ /* Get all intermediate image sizes. */
+ $intermediate_sizes = get_intermediate_image_sizes();
+ $add_sizes = array();
+
+ /* Loop through each of the intermediate sizes, adding them to the $add_sizes array. */
+ foreach ( $intermediate_sizes as $size )
+ $add_sizes[$size] = $size;
+
+ /* Merge the original array, keeping it intact, with the new array of image sizes. */
+ $sizes = array_merge( $add_sizes, $sizes );
+
+ /* Return the new sizes plus the old sizes back. */
+ return $sizes;
+}
+
+/**
* Loads the correct function for handling attachments. Checks the attachment mime type to call
* correct function. Image attachments are not loaded with this function. The functionality for them
* should be handled by the theme's attachment or image attachment file.
View
29 functions/utility.php
@@ -17,9 +17,6 @@
/* Add extra file headers for themes. */
add_filter( 'extra_theme_headers', 'hybrid_extra_theme_headers' );
-/* Add all image sizes to the image editor to insert into post. */
-add_filter( 'image_size_names_choose', 'hybrid_image_size_names_choose' );
-
/**
* This function is for adding extra support for features not default to the core post types.
* Excerpts are added to the 'page' post type. Comments and trackbacks are added for the
@@ -77,32 +74,6 @@ function hybrid_extra_theme_headers( $headers ) {
}
/**
- * Adds theme/plugin custom images sizes added with add_image_size() to the image uploader/editor. This
- * allows users to insert these images within their post content editor.
- *
- * @since 1.3.0
- * @access private
- * @param array $sizes Selectable image sizes.
- * @return array $sizes
- */
-function hybrid_image_size_names_choose( $sizes ) {
-
- /* Get all intermediate image sizes. */
- $intermediate_sizes = get_intermediate_image_sizes();
- $add_sizes = array();
-
- /* Loop through each of the intermediate sizes, adding them to the $add_sizes array. */
- foreach ( $intermediate_sizes as $size )
- $add_sizes[$size] = $size;
-
- /* Merge the original array, keeping it intact, with the new array of image sizes. */
- $sizes = array_merge( $add_sizes, $sizes );
-
- /* Return the new sizes plus the old sizes back. */
- return $sizes;
-}
-
-/**
* Looks for a template based on the hybrid_get_context() function. If the $template parameter
* is a directory, it will look for files within that directory. Otherwise, $template becomes the
* template name prefix. The function looks for templates based on the context of the current page
Please sign in to comment.
Something went wrong with that request. Please try again.