WordPress.org

Ready to get started?Download WordPress

Forums

How to manipulate core file from functions.php (3 posts)

  1. Kevin Daniels
    Member
    Posted 1 year ago #

    How do I modify line 352 of media.php inside wp-includes folder from functions.php (so it doesn't get over-written upon new releases)

    the line is:
    $s_y = floor( ($orig_h - $crop_h) / 2 );

    I want it to stay:
    $s_y = floor( ($orig_h - $crop_h) / 4 );

    this basically makes it so a hard crop will use the area slightly above the center so if the image is portrait oriented and of people their heads wont get cut off

  2. Andrew Bartel
    Member
    Posted 1 year ago #

    You don't. Didn't you know that every time someone hacks core God kills a kitten?

    http://websynthesis.com/wsa/wp-content/uploads/2012/06/hack_core.jpg

    This is untested but the function that line 352 is in says you can user the image_resize_dimensions filter to play around with it. Do that instead.

  3. Kevin Daniels
    Member
    Posted 1 year ago #

    its not the dimensions I want to change, I want to change the crop position

Topic Closed

This topic has been closed to new replies.

About this Topic