Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Widget Posts functionality #12

Merged
merged 35 commits into from
May 28, 2015
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
85da60f
Introduce Widget Posts functionality.
westonruter May 20, 2015
99a0cb7
Update wp-dev-lib 7f29252...b3b6c2a: Merge pull request xwp/wp-dev-li…
westonruter May 23, 2015
8fe6a53
Checkout PHPUnit tests
westonruter May 23, 2015
e5e5ce3
Add unit test to run Tests_WP_Customize_Widgets w/ Widget Posts active
westonruter May 23, 2015
92b20d5
Update wp-dev-lib b3b6c2a...fc1c489: Fix grep for PHP and JS files
westonruter May 23, 2015
7c2ec85
Revert change to .jscsrc in 92b20d52f
westonruter May 23, 2015
53bda21
Tweak Travis before_script to fix unit test failure
westonruter May 23, 2015
3d75e53
Add Efficient_Multidimensional_Setting_Sanitizing to Core test
westonruter May 23, 2015
f500d2c
Fix applying plugin during core unit tests; fix bugs revealed
westonruter May 23, 2015
d25ab21
Add CLI commands
westonruter May 23, 2015
8aca737
Only call update_option in set_widget_number if changed; prevent widg…
westonruter May 23, 2015
5f43beb
Ensure widget numbers less than 2 are not used
westonruter May 23, 2015
d9a36a7
Improve show CLI command to warn if not exists
westonruter May 23, 2015
3672308
Ensure post type gets registered when required, along with requisite …
westonruter May 23, 2015
4da8ad0
Fix unit tests by ensuring registered post type gets cleaned up
westonruter May 23, 2015
ce02f60
Compare literal arrays for identity in filter_pre_update_option_widge…
westonruter May 23, 2015
9221f9b
Have Widget_Settings::offsetGet() return empty array when instance da…
westonruter May 23, 2015
439b1e0
Fix filters for short-circuiting widget settings
westonruter May 24, 2015
d61f76d
Handle deletion of widget posts via unsetting from Widget_Settings
westonruter May 24, 2015
44a6497
Store widget instances as base64-encoded PHP-serialized strings to pr…
westonruter May 24, 2015
4a880aa
Fix unit tests after introduction of Widget_Posts::parse_post_content…
westonruter May 24, 2015
ad24505
Add support for WXR import/export
westonruter May 24, 2015
ace6811
Add is_enabled(), enable(), disable() methods; use yes/no value
westonruter May 24, 2015
8ca601d
Store pretty-printed JSON instance in post_content for search indexin…
westonruter May 24, 2015
66d7013
Stop calling sanitization update callback unnecessarily
westonruter May 24, 2015
065a49c
Fix update_widget() to preserve post ID and thus actually update the …
westonruter May 24, 2015
c6ec296
Remove try/catch since get_widget_instance_data no longer throws exce…
westonruter May 24, 2015
3baa6e3
Make wp widget-posts show an alias for get command
westonruter May 25, 2015
9f65de0
Add import CLI command; improve migrate and import routines
westonruter May 25, 2015
84040ba
Introduce get_post_content_filtered() wrapper for parse_post_content_…
westonruter May 25, 2015
a532454
Ensure that post_content gets populated with pretty JSON on WXR import
westonruter May 25, 2015
1bc04d1
Update wp-dev-lib fc1c489...2875eff: Fix filter_php_files
westonruter May 26, 2015
d5fbcfa
Add support for importing from exports from WP Options Importer on VIP
westonruter May 26, 2015
f4901a4
Make method private to prevent WP-CLI from exposing as command
westonruter May 27, 2015
c095337
Debug travis unit tests
westonruter May 28, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Store pretty-printed JSON instance in post_content for search indexin…
…g and post revisions UI
  • Loading branch information
westonruter committed May 24, 2015
commit 8ca601d0cdb6a1d12cd64513145712011ba88644
4 changes: 2 additions & 2 deletions php/class-widget-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ function insert_widget( $id_base, $instance = array() ) {
$widget_number = $this->plugin->widget_number_incrementing->incr_widget_number( $id_base );
$post_arr = array(
'post_name' => "$id_base-$widget_number",
// @todo 'post_content' => wp_json_encode( $instance ), // for search indexing
'post_content' => wp_json_encode( $instance, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ), // For search indexing and post revision UI.
'post_content_filtered' => static::encode_post_content_filtered( $instance ),
'post_status' => 'publish',
'post_type' => static::INSTANCE_POST_TYPE,
Expand Down Expand Up @@ -703,7 +703,7 @@ function update_widget( $widget_id, $instance = array() ) {
$post_arr = array(
'post_title' => ! empty( $instance['title'] ) ? $instance['title'] : '',
'post_name' => $widget_id,
// @todo 'post_content' => wp_json_encode( $instance ), // for search indexing
'post_content' => wp_json_encode( $instance, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ), // For search indexing and post revision UI.
'post_content_filtered' => static::encode_post_content_filtered( $instance ),
'post_status' => 'publish',
'post_type' => static::INSTANCE_POST_TYPE,
Expand Down