3202 posts
  • Sold between 5 000 and 10 000 dollars
  • United States
  • Bought between 10 and 49 items
  • Has been a member for 4-5 years
  • Exclusive Author
organicbee says



.... WordPress – April 23, 2013 – JavaScript files need to be placed at the bottom, barring critical exclusion. [Modernizr, for instance] You can do this with the $in_footer argument …..
thanx for the heads up, so in order to use $in_footer parameter, what do you specify for $deps and $ver params if you need those as default? jayc
array() for $deps and false for $ver.

not necessarily

if it requires a lib then the $dep would be something like array('jquery')

You want to put a $ver to help if its cached so if its a jQuery plugin, use the version number it has. if its doesnt have a version number or its a custom script use something like wp_get_theme()->display('Version')(WP 3.4+)

1466 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
  • Croatia
OriginalEXE says




.... WordPress – April 23, 2013 – JavaScript files need to be placed at the bottom, barring critical exclusion. [Modernizr, for instance] You can do this with the $in_footer argument …..
thanx for the heads up, so in order to use $in_footer parameter, what do you specify for $deps and $ver params if you need those as default? jayc
array() for $deps and false for $ver.

not necessarily

if it requires a lib then the $dep would be something like array('jquery')

You want to put a $ver to help if its cached so if its a jQuery plugin, use the version number it has. if its doesnt have a version number or its a custom script use something like wp_get_theme()->display('Version')(WP 3.4+)

He asked for defaults, that’s exactly what I wrote.

10 posts
  • Bought between 10 and 49 items
  • Has been a member for 4-5 years
borisvs says

2. The WordPress theme should make use of the following inbuilt functions to validate or santize content on input or escape any questionable content for put. http://codex.wordpress.org/Data_Validation

My theme is soft rejected, and this is the message I’ve received from the reviewer. But I don’t have any idea what to fix. Does somebody has an example of what is wrong and what is the correct way? I would really appreciate it!

1466 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
  • Croatia
OriginalEXE says


2. The WordPress theme should make use of the following inbuilt functions to validate or santize content on input or escape any questionable content for put. http://codex.wordpress.org/Data_Validation
My theme is soft rejected, and this is the message I’ve received from the reviewer. But I don’t have any idea what to fix. Does somebody has an example of what is wrong and what is the correct way? I would really appreciate it!

Example:

wrong:
$postmeta = $_POST['fieldname'];
update_post_meta( $post->ID, 'fieldkey', 'fieldname' );
correct:
$postmeta = sanitize_text_field( $_POST['fieldname'] );
update_post_meta( $post->ID, 'fieldkey', 'fieldname' );

That’s just an example, actual function depends on the type of data you are expecting.

438 posts WordPress Gurus!
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 200 and 499 users
  • United States
ThemeBeans says

1. Don’t unregister default widgets, even if they are replaced with better versions.

Yea this is pretty stupid imo.

707 posts
  • Sold between 10 000 and 50 000 dollars
  • Referred between 10 and 49 users
  • Bought between 10 and 49 items
  • Has been a member for 5-6 years
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
ChillThemes says


1. Don’t unregister default widgets, even if they are replaced with better versions.
Yea this is pretty stupid imo.

The ‘rule’ or unregistering widgets?

1729 posts Don't Worry, Be Happy
  • Beta Tester
  • Football Contest Participant/Runner-up
  • Grew a moustache for the Envato Movember competition
  • Elite Author
  • United States
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 3-4 years
  • Referred between 200 and 499 users
+3 more
FinalDestiny says

Your global variables should always be named in such a way as to NOT cause conflicts. Try to use a prefix for that. http://crappycode.wordpress.com/2012/12/30/global-data/

10 posts
  • Bought between 10 and 49 items
  • Has been a member for 4-5 years
borisvs says



2. The WordPress theme should make use of the following inbuilt functions to validate or santize content on input or escape any questionable content for put. http://codex.wordpress.org/Data_Validation
My theme is soft rejected, and this is the message I’ve received from the reviewer. But I don’t have any idea what to fix. Does somebody has an example of what is wrong and what is the correct way? I would really appreciate it!

Example:

wrong:
$postmeta = $_POST['fieldname'];
update_post_meta( $post->ID, 'fieldkey', 'fieldname' );
correct:
$postmeta = sanitize_text_field( $_POST['fieldname'] );
update_post_meta( $post->ID, 'fieldkey', 'fieldname' );
That’s just an example, actual function depends on the type of data you are expecting.

Ok, thanks for the example. Do I also have to validate all the content from my theme options panel and meta boxes itself?

Example:
$tagline = get_post_meta($post->ID, 'meta_tagline', true);
echo $tagline;
Should this be something like this:
echo esc_html($tagline);
?? Or isn’t this required?
1466 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
  • Croatia
OriginalEXE says

Yes, for any html output, use esc_html

149 posts
  • Bought between 1 and 9 items
  • Elite Author
  • Europe
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
  • Sold between 100 000 and 250 000 dollars
starshade says

Just a heads up here since no one posted for some time. Here is what our soft rejection contained:

wp_footer needs to be immediately before the end of the body tag. http://codex.wordpress.org/Function_Reference/wp_footer

All your styles and scripts must be enqueued in functions.php during the wp_enqueue_script action. http://codex.wordpress.org/Function_Reference/wp_enqueue_script

Enqueue the main stylesheet (style.css) during the wp_enqueue_script action:

/**
 * Enqueue main stylesheet.
 */
function mytheme_style() {
  wp_enqueue_style( 'mytheme-style', get_bloginfo( 'stylesheet_url' ), array(), '20130312' );
}
add_action( 'wp_enqueue_scripts', 'mytheme_style' );

Cheers to everyone and good luck wp-theming!

by
by
by
by
by
by