Giter Club home page Giter Club logo

wp-customize-posts's People

Contributors

danielbachhuber avatar delawski avatar fjarrett avatar garyjones avatar jeffpaul avatar johnregan3 avatar jonathanbardo avatar lgedeon avatar mehigh avatar mohdsayed avatar patelutkarsh avatar pingram3541 avatar sunnyratilal avatar valendesigns avatar westonruter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wp-customize-posts's Issues

Allow new posts and pages to be created

In addition to editing existing posts, entirely new posts/pages should also be able to be created in the Customizer. There are two approaches we could go here:

(1) It could use the approach of creating new nav_menu_item posts where the pre-created post has a negative post ID which is used to designate a post that has not been inserted yet.
(2) Or it could actually create an auto-draft post in the DB which would give us a real ID to reference.

It would definitely be less complicated to implement (2), since all the DB queries would work in the preview without having to inject pseudo-posts into query results. However, I also like (1) because it is more philosophically pure in that it truly does not touch the DB before Save & Publish.

Once the technical architecture for representing a pre-created post is settled, there is then the question of the UI for creating these posts. One integration option is in Customizer Nav Menus via the Add Item UI (see #49). Another integration option is to extend the post type's panel to add a “New Post” button before the list of post sections (see #50).

Update post titles in post lists outside The Loop

Selective refresh currently applies title and content changes based on the hEntry microformat, looking for .entry-title and .entry-content. This works well for The Loop.

When updating a post/page which appears in a Recent Posts widget or Pages widget, the new title should ideally appear in the widget as well as in The Loop. The Pages widget (via wp_list_pages()) does add CSS class names for the underlying post ID for each page that is listed, which will make it easy to target the update. The Recent Posts widget does not include these class names, however, so it won't be as easy. If pretty permalinks are turned off (#42) it could find posts by looking at the URLs directly since they will include the post ID (e.g. /?p=123). This assumes, of course, that the link text is actually the post title itself and not some other text. This is definitely a nice to have, and not something very important.

For other post lists, it may make sense to require microdata/microformats in order for the updates to apply. This is a sensible requirement for themes to have.

Let “Preview” button in post edit open Customizer with post section autofocused

When previewing a post from the post edit screen, it should open in the Customizer. This avoids requiring the user to click an additional “Customize” link from the admin bar and to navigate to the post in the Customizer pane.

  • There needs to also be a post status dropdown in the Customizer (#40) so that drafts can actually be published from the Customizer. (We can just skip allowing post to be published from Customizer view.)
  • When clicking “Preview” the Customizer should be loaded via customize-loader and any changes made to the post should be synced back to the parent frame in case “Save & Publish” is not clicked.
  • Clicking “Close” should not prompt with AYS confirmation because the value should have been synced to the editor in the parent frame.

See also http://wordpress.org/plugins/customizer-everywhere/

Add more filters and validation checks for post data sanitization

Instead of just relying on wp_update_post() when the data finally gets updated in the DB, we should ideally be doing similar checks in the sanitization_callback so that the right data gets supplied in the preview. For example, it would probably be good to run it through wp_insert_post_data.

Improve TinyMCE editor on desktop

Some suggestions have been raised (see #45 for mobile-specific improvements):

“I think removing the need to click the edit content button and showing the wysiwyg right away would actually be more straightforward what do you think?” (@jonathanbardo via Facebook)

“Make it full screen. :) Not fullscreen mode. I think it would be better to make it full height by default (and maybe full width). + view toggle.” (@MichaelArestad via Twitter)

“I really like the idea of Open Editor, I think as the editor opens, the customizer window should be minimized so that one could write in a full width WYSIWYG editor.” (@ahmadawais via WP Trac)

Implement control and preview for post_date

To start, this can be a simple text field containing the date. For specifics regarding the UI, see #53.

Care will need to be taken when modifying the date time so that the post will continue to appear in the preview when the date is in the future. Also, it would seem logical that changing the date should result in the order of the posts changing in the preview.

There may need to be a partial registered for the display of a post date. If not, then the entire content part will need to be refreshed (#36).

Focus on specific post fields that have conflicts

When there are post save conflicts due to concurrent editing of a post, the post fields get an error message indicating the their version of each conflicted field. In addition to showing the error message, we should focus on the first specific conflicted field (if the section is expanded), instead of just focusing on the first control regardless.

Introduce partial to represent entire post part template

When editing postmeta or some aspect of a post that does not have a specific partial, the entire post will need to be updated in the preview as opposed to just the specific partial representing the field modified. In all of the core themes, the posts have a content template part which is a perfect candidate for this. So when editing a post field or post meta that doesn't have a partial (or placement) in the preview, the fallback should be refreshing the entire post template part. This will require a new WP_Customize_Partial that is aware of the path to the template part, whether it is content, template-parts/content.

Improve TinyMCE editor in mobile

The editor is not currently optimized for mobile in the Customize Posts integration.

Deeper UX/UI work is needed on the mobile editor, but some issues that could improve thing:

  • Collapse button for editor should not get overlapped by editor.
  • Editor shouldn't get positioned above other controls when pane is expanded. Editor should appear inline.
    customize__wordpress_develop_ _just_another_wordpress_site_
  • Editor should be able to expand to full screen in mobile properly.
    customize__wordpress_develop_ _just_another_wordpress_site_

Break up WP_Post_Edit_Customize_Control into field-specific controls

Instead of having one monolithic control, there should be separate controls for:

  • Title
  • Content
  • Excerpt
  • Publish Date
  • Slug
  • Author
  • Status
  • Parent
  • Menu order
  • Page template
  • Featured image
  • Meta (custom fields)

Doing it in this way will help users opt-in to the fields they need, and it would make it easier to extend and add new controls more modularly for metaboxes.

We'll also need to break up the settings as well.

The gotcha here is the "Select post to edit" dropdown. In the way it is right now, it would be hard to manage the breakup into individual controls because everything is in one section. An alternative is to switch to using panels, so each post resides within a section in a Posts panel. This would require sections to be dynamically generated in the panel, but there is no JS API for this right now (see #28709).

In the mean time, it is probably better to get rid of the "Select post to edit" control altogether, and automatically load up posts when the preview has them as the queried object.

Add postmeta setting and base control

A page template and featured image are both stored in postmeta. These should use a WP_Customize_Postmeta_Setting with unique UIs for a page dropdown and (re-used) image media selector control. These can serve as the basis for creating more complex controls that map to multiple postmeta, or a control which manipulates a non-scalar postmeta value (an array).

Handle serialized values via JSON

Just as the Customizer has a sanitize_js callback, which converts a PHP value into an equivalent JSON representation which then gets converted back to PHP when saving/previewing, we could take the same approach for handling PHP-serialized postmeta.

Keyboard shortcut to Open/Close Editor.

It would be handy to have a keyboard shortcut to open and close the editor instead of clicking the button. I thought Ctrl+Shift+E on PC and Cmd+Shift+E on Mac would make sense.

I created a feature branch with this functionality, but realised its probably better to do a fork to PR back. Will fix.

Add setting-less control for selecting posts to edit in the preview

  • Pre-select the currently-previewed post.
  • Allow any number of posts to be added to the customizer for previewing. Each post gets its own dynamically-created control (and setting).
  • Use the queried-posts message from the preview to suggest which post to edit.
  • Send the queried object post as the highest suggestion.

Implement date/time picker for publish date

Published date input can use the type="date"

I would have submitted a PR but looks like the new version doesn't contain this date input meta only W.org version does.

— We can use type="date" here (In the old W.org repo version)

Image

Improve support for previewing Shortcake's post elements

The post elements made available by Shortcake should be able to be added and manipulated in Customizer editor.

When a post_content partial is refreshed, any dynamic elements like Twitter and Facebook, need to be dynamically constructed such as has started to be developed for widgets in Jetpack: https://github.com/xwp/wp-customize-partial-refresh/blob/master/js/plugin-support/jetpack.js

And which Jetpack's Infinity Scroll does for post content: https://github.com/Automattic/jetpack/blob/master/modules/infinite-scroll/infinity.js

In fact, if we just trigger the post-load event when a post content partial is refreshed, this may get us most of the way by allowing us to piggyback on Jetpack's infinite scroll.

So... this is interesting

I love the concept. Want to integrate it in as a feature of Redux Framework perhaps? We're one of the largest option frameworks out there and we already have a really powerful metaboxes extension that does stuff like this:

screen shot 2014-05-25 at 3 51 54 pm

It would be amazing to add a preview option as well to that. ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.