Opened 8 months ago

Last modified 4 weeks ago

#22058 new enhancement

Custom background vertical position

Reported by: grapplerulrich Owned by:
Priority: normal Milestone: Awaiting Review
Component: Appearance Version: 3.4.2
Severity: normal Keywords: 2nd-opinion has-patch needs-testing
Cc: mdhansen@…

Description

For the the custom background display options there is only left, centre and right position. The top and bottom position is missing.

Attachments (6)

custom-background.php (17.1 KB) - added by grapplerulrich 7 months ago.
custom-background
theme.php (52.7 KB) - added by grapplerulrich 7 months ago.
theme.php
22058.patch (4.4 KB) - added by SergeyBiryukov 7 months ago.
A patch with grapplerulrich's changes
22058.2.patch (5.6 KB) - added by grapplerulrich 7 months ago.
22058.patch
22058.3.patch (7.2 KB) - added by grapplerulrich 7 months ago.
22058.2.patch
22058.diff (10.6 KB) - added by cdog 5 weeks ago.

Download all attachments as: .zip

Change History (30)

  • Component changed from Themes to Appearance
  • Cc mdhansen@… added

Related post on the forum http://wordpress.org/support/topic/twenty-ten-align-background-to-bottom


I think adding this to customizer is a good idea. I tested background-position: left bottom; and it works in Chromium 20 and Firefox 15. We may need to check if IE8 would support the vertical position.

  • Keywords 2nd-opinion added

I created a solution. I attached the two files that I edited.
Here is the test site I am running on.
http://www.grappler.tk/wpdev/

This is my first edit so please bear with me.

  • Keywords needs-patch added

Rather than full files, you can submit a patch using Subversion:
http://make.wordpress.org/core/handbook/submitting-a-patch/

custom-background

theme.php

I have changed the files to patches.
Here is a screenshot of the admin view.
http://pix.am/LSq0/

I tested in in IE7-9, Opera, FF and Chrome on Win7 and it works.

A patch with grapplerulrich's changes

  • Keywords has-patch added; needs-patch removed

Tested the patch and it works well. We need to also add this to customizer.

22058.patch

I have added the patch with the customizer. Here is a screenshot.
http://pix.am/dPVz/

comment:9 follow-up: ↓ 10   MikeHansenMe7 months ago

@grapplerurlrich the patch works if you set horizontal then the vertical but if you go back to change the horizontal after setting vertical it sets vertical to top. At least in the preview, it does save them correctly and display as expected on the site.

comment:10 in reply to: ↑ 9   grapplerulrich7 months ago

Replying to MikeHansenMe:

@grapplerurlrich the patch works if you set horizontal then the vertical but if you go back to change the horizontal after setting vertical it sets vertical to top. At least in the preview, it does save them correctly and display as expected on the site.

What tool do you use to minifiy the js?

Set define( 'SCRIPT_DEBUG', true); then edit the dev.js file instead of the min file.

22058.2.patch​

@MikeHansenMe Thanks, I updated the patch. I also saw a problem with the "background-attachment:" and fixed that too. How long will it take for it to be implemented in WordPress?

comment:13 in reply to: ↑ 12   MikeHansenMe7 months ago

Replying to grapplerulrich:

@MikeHansenMe Thanks, I updated the patch. I also saw a problem with the "background-attachment:" and fixed that too. How long will it take for it to be implemented in WordPress?

Tested and can confirm the customizer is now working as expected. We are currently in a feature freeze for this release cycle so it will likely be reviewed after 3.5 comes out when enhancements are being considered. Thanks for contributing.

Related: ticket:14979.

comment:15 follow-up: ↓ 16   MikeHansenMe5 weeks ago

Patch still applies but tested again and the changing the vertical position to center shows no change. It does save the change but does not show the change immediately as the horizontal change does.

Last edited 5 weeks ago by MikeHansenMe (previous) (diff)

cdog5 weeks ago

comment:16 in reply to: ↑ 15   cdog5 weeks ago

Replying to MikeHansenMe:

Patch still applies but tested again and the changing the vertical position to center shows no change. It does save the change but does not show the change immediately as the horizontal change does.

Please check: attachment:22058.diff. I've refreshed the patch and filled out missing parts.

comment:17 follow-up: ↓ 18   MikeHansenMe5 weeks ago

Patch does not seem to show the change when center or bottom are selected.

comment:18 in reply to: ↑ 17   cdog5 weeks ago

Replying to MikeHansenMe:

Patch does not seem to show the change when center or bottom are selected.

I'm testing it in Firefox 16 with Twenty Eleven and it works as intended, both from Theme Customizer and Appearance > Background.

comment:19 follow-up: ↓ 20   MikeHansenMe5 weeks ago

When you change the vertical positioning of the background image the preview does not update. It does after saving and refreshing. However, it should happen like horizontal does with immediate preview before saving. I tested using FF 20 and Chrome 25 on Ubuntu. I can test on Windows tonight to see if it works on Windows w/ IE.

comment:20 in reply to: ↑ 19   cdog5 weeks ago

  • Keywords needs-testing added

Replying to MikeHansenMe:

When you change the vertical positioning of the background image the preview does not update. It does after saving and refreshing.

Are you sure you're testing the latest patch? Please revert any changes and then apply attachment:22058.diff. Just tested it on IE and it seems to behave correctly. Where exactly do you encounter the issue, in Theme Customizer, in Appearance > Background or both? What are the steps to repoduce it? Thanks for helping.

comment:21 follow-up: ↓ 22   MikeHansenMe5 weeks ago

I am running the most current trunk version(3.6-beta1-24023) and reverting all patches prior to testing. Then applying your patch 22058.diff

Please see the video for explanation
http://bit.ly/11CSUBC

Last edited 5 weeks ago by MikeHansenMe (previous) (diff)

comment:22 in reply to: ↑ 21   cdog5 weeks ago

Replying to MikeHansenMe:

Please see the video for explanation
http://bit.ly/11CSUBC

Well, that's really strange. Just tested it again, now using IE9 and FF21 on Windows and it works as expected. Please check that you have defined SCRIPT_DEBUG in your wp-config.php file:

define('WP_DEBUG', true);
define('SCRIPT_DEBUG', true);

It seems that everything is loaded, except recent changes to JS. Maybe you're using the minified scripts which are not affected by the patch. If it's not this, please take a look at the console and let me know if there are any errors. Thanks!

comment:23 follow-up: ↓ 24   bpetty5 weeks ago

I'm seeing the same thing as MikeHansenMe in Chrome 25.0.1364.160.

... and yes, I'm using SCRIPT_DEBUG.

comment:24 in reply to: ↑ 23   cdog4 weeks ago

Replying to bpetty:

I'm seeing the same thing as MikeHansenMe in Chrome 25.0.1364.160.

... and yes, I'm using SCRIPT_DEBUG.

After applying the patch go to Appearance > Background (or Customize). Then press Ctrl + F5 to reload (override cache) and try uploading an image again. Please let me know if it helps.

Note: See TracTickets for help on using tickets.