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

  1. Kevin Daniels
    Posted 2 years 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
    Posted 2 years ago #

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


    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
    Posted 2 years 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