Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 11 additions & 11 deletions addons/post-navigation/classes/PostNavigationRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private static function render_preview_from_visual_controls(array $settings, arr

// Check if we should hide when single post
if (!empty($settings['hide_when_single_post']) && $total_posts <= 1) {
return '<p style="color: #999; font-style: italic;">' . esc_html__('Navigation hidden (series has only one post)', 'publishpress-series') . '</p>';
return '<p style="color: #999; font-style: italic;">' . esc_html__('Navigation hidden (series has only one post)', 'organize-series') . '</p>';
}

$content_parts = [];
Expand Down Expand Up @@ -254,7 +254,7 @@ private static function render_preview_from_visual_controls(array $settings, arr
? $preview_posts['first']
: null;

$label = isset($settings['first_label']) ? $settings['first_label'] : __('Series Home', 'publishpress-series');
$label = isset($settings['first_label']) ? $settings['first_label'] : __('Series Home', 'organize-series');
if ($first_type === 'post_title' && $first_post) {
$label = get_the_title($first_post->ID);
}
Expand All @@ -270,7 +270,7 @@ private static function render_preview_from_visual_controls(array $settings, arr
? $preview_posts['previous']
: null;

$label = isset($settings['previous_label']) ? $settings['previous_label'] : __('Previous', 'publishpress-series');
$label = isset($settings['previous_label']) ? $settings['previous_label'] : __('Previous', 'organize-series');
if ($prev_type === 'post_title' && $prev_post) {
$label = get_the_title($prev_post->ID);
}
Expand All @@ -285,7 +285,7 @@ private static function render_preview_from_visual_controls(array $settings, arr
? $preview_posts['first']
: null;

$label = isset($settings['first_label']) ? $settings['first_label'] : __('Series Home', 'publishpress-series');
$label = isset($settings['first_label']) ? $settings['first_label'] : __('Series Home', 'organize-series');
if ($first_type === 'post_title' && $first_post) {
$label = get_the_title($first_post->ID);
}
Expand All @@ -301,7 +301,7 @@ private static function render_preview_from_visual_controls(array $settings, arr
? $preview_posts['next']
: null;

$label = isset($settings['next_label']) ? $settings['next_label'] : __('Next', 'publishpress-series');
$label = isset($settings['next_label']) ? $settings['next_label'] : __('Next', 'organize-series');
if ($next_type === 'post_title' && $next_post) {
$label = get_the_title($next_post->ID);
}
Expand All @@ -316,7 +316,7 @@ private static function render_preview_from_visual_controls(array $settings, arr
? $preview_posts['first']
: null;

$label = isset($settings['first_label']) ? $settings['first_label'] : __('Series Home', 'publishpress-series');
$label = isset($settings['first_label']) ? $settings['first_label'] : __('Series Home', 'organize-series');
if ($first_type === 'post_title' && $first_post) {
$label = get_the_title($first_post->ID);
}
Expand Down Expand Up @@ -392,7 +392,7 @@ private static function render_from_visual_controls(array $settings, array $cont
$first_post = self::extract_post_from_nav_link($first_link);
}
if ($first_type === 'custom') {
$first_label = isset($settings['first_label']) ? $settings['first_label'] : __('Series Home', 'publishpress-series');
$first_label = isset($settings['first_label']) ? $settings['first_label'] : __('Series Home', 'organize-series');
$first_link = self::replace_nav_link_text($first_link, esc_html($first_label));
} elseif ($first_type === 'post_title') {
if ($first_post) {
Expand All @@ -418,7 +418,7 @@ private static function render_from_visual_controls(array $settings, array $cont
}
// Replace link text with configured label
if ($prev_type === 'custom') {
$prev_label = isset($settings['previous_label']) ? $settings['previous_label'] : __('Previous', 'publishpress-series');
$prev_label = isset($settings['previous_label']) ? $settings['previous_label'] : __('Previous', 'organize-series');
$prev_link = self::replace_nav_link_text($prev_link, esc_html($prev_label));
} elseif ($prev_type === 'post_title') {
if ($prev_post) {
Expand All @@ -444,7 +444,7 @@ private static function render_from_visual_controls(array $settings, array $cont
$first_post = self::extract_post_from_nav_link($first_link);
}
if ($first_type === 'custom') {
$first_label = isset($settings['first_label']) ? $settings['first_label'] : __('Series Home', 'publishpress-series');
$first_label = isset($settings['first_label']) ? $settings['first_label'] : __('Series Home', 'organize-series');
$first_link = self::replace_nav_link_text($first_link, esc_html($first_label));
} elseif ($first_type === 'post_title') {
if ($first_post) {
Expand Down Expand Up @@ -472,7 +472,7 @@ private static function render_from_visual_controls(array $settings, array $cont
}
// Replace link text with configured label
if ($next_type === 'custom') {
$next_label = isset($settings['next_label']) ? $settings['next_label'] : __('Next', 'publishpress-series');
$next_label = isset($settings['next_label']) ? $settings['next_label'] : __('Next', 'organize-series');
$next_link = self::replace_nav_link_text($next_link, esc_html($next_label));
} elseif ($next_type === 'post_title') {
if ($next_post) {
Expand All @@ -498,7 +498,7 @@ private static function render_from_visual_controls(array $settings, array $cont
$first_post = self::extract_post_from_nav_link($first_link);
}
if ($first_type === 'custom') {
$first_label = isset($settings['first_label']) ? $settings['first_label'] : __('Series Home', 'publishpress-series');
$first_label = isset($settings['first_label']) ? $settings['first_label'] : __('Series Home', 'organize-series');
$first_link = self::replace_nav_link_text($first_link, esc_html($first_label));
} elseif ($first_type === 'post_title') {
if ($first_post) {
Expand Down
22 changes: 11 additions & 11 deletions addons/post-navigation/includes/class-admin-ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public static function register_menu()
{
add_submenu_page(
'orgseries_options_page',
__('Post Navigation', 'publishpress-series'),
__('Post Navigation', 'publishpress-series'),
__('Post Navigation', 'organize-series'),
__('Post Navigation', 'organize-series'),
'manage_publishpress_series',
'edit.php?post_type=' . PPS_Series_Post_Navigation_Utilities::POST_TYPE,
null,
Expand Down Expand Up @@ -64,7 +64,7 @@ public static function add_meta_boxes()

add_meta_box(
'pps_series_post_navigation_preview',
__('Series Post Navigation Preview', 'publishpress-series'),
__('Series Post Navigation Preview', 'organize-series'),
[__CLASS__, 'render_preview_box'],
PPS_Series_Post_Navigation_Utilities::POST_TYPE,
'normal',
Expand All @@ -73,7 +73,7 @@ public static function add_meta_boxes()

add_meta_box(
'pps_series_post_navigation_editor',
__('Series Post Navigation Editor', 'publishpress-series'),
__('Series Post Navigation Editor', 'organize-series'),
[__CLASS__, 'render_editor_box'],
PPS_Series_Post_Navigation_Utilities::POST_TYPE,
'normal',
Expand All @@ -82,7 +82,7 @@ public static function add_meta_boxes()

add_meta_box(
'pps_series_post_navigation_shortcode',
__('Shortcode', 'publishpress-series'),
__('Shortcode', 'organize-series'),
[__CLASS__, 'render_shortcode_box'],
PPS_Series_Post_Navigation_Utilities::POST_TYPE,
'side',
Expand Down Expand Up @@ -179,18 +179,18 @@ public static function render_editor_box(WP_Post $post)
public static function render_shortcode_box(WP_Post $post)
{
$layout_slug = 'pps_nav_' . $post->ID;
echo '<p><label for="pps-series-post-navigation-shortcode">' . esc_html__('Use this shortcode:', 'publishpress-series') . '</label></p>';
echo '<p><label for="pps-series-post-navigation-shortcode">' . esc_html__('Use this shortcode:', 'organize-series') . '</label></p>';
echo '<textarea id="pps-series-post-navigation-shortcode" readonly class="widefat" rows="2">[pps_post_navigation layout="' . esc_attr($layout_slug) . '"]</textarea>';
echo '<p class="description">' . esc_html__('Insert into posts or pages to display this Series Post Navigation manually.', 'publishpress-series') . '</p>';
echo '<p class="description">' . esc_html__('Insert into posts or pages to display this Series Post Navigation manually.', 'organize-series') . '</p>';
}

/**
* Add custom columns
*/
public static function register_columns($columns)
{
$columns['series_nav_default'] = esc_html__('Default Navigation', 'publishpress-series');
$columns['series_nav_shortcode'] = esc_html__('Shortcode', 'publishpress-series');
$columns['series_nav_default'] = esc_html__('Default Navigation', 'organize-series');
$columns['series_nav_shortcode'] = esc_html__('Shortcode', 'organize-series');
unset($columns['date']);

return $columns;
Expand Down Expand Up @@ -409,15 +409,15 @@ private static function render_field_input(array $args)
'<button type="button" class="button pps-media-upload-button" data-field-id="%s"%s>%s</button> ',
$key,
$pro_locked ? ' disabled="disabled"' : '',
$has_image ? __('Change Image', 'publishpress-series') : __('Select Image', 'publishpress-series')
$has_image ? __('Change Image', 'organize-series') : __('Select Image', 'organize-series')
);

if ($has_image) {
printf(
'<button type="button" class="button pps-media-remove-button" data-field-id="%s"%s>%s</button>',
$key,
$pro_locked ? ' disabled="disabled"' : '',
__('Remove Image', 'publishpress-series')
__('Remove Image', 'organize-series')
);
}

Expand Down
18 changes: 9 additions & 9 deletions addons/post-navigation/includes/class-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function update_preview()

$post_id = isset($_POST['post_id']) ? (int) $_POST['post_id'] : 0;
if (! $post_id) {
wp_send_json_error(['message' => __('Invalid post ID.', 'publishpress-series')]);
wp_send_json_error(['message' => __('Invalid post ID.', 'organize-series')]);
}

$form_data = isset($_POST['settings']) ? wp_unslash($_POST['settings']) : '';
Expand Down Expand Up @@ -78,21 +78,21 @@ public static function update_preview()
}

if (! $series_term) {
wp_send_json_error(['message' => __('No series available to preview.', 'publishpress-series')]);
wp_send_json_error(['message' => __('No series available to preview.', 'organize-series')]);
}

$posts = PPS_Series_Post_Navigation_Utilities::get_sample_series_posts($series_term->term_id);
$total_posts = count($posts);

if (0 === $total_posts) {
wp_send_json_error(['message' => __('No posts found in series to preview.', 'publishpress-series')]);
wp_send_json_error(['message' => __('No posts found in series to preview.', 'organize-series')]);
}

$current_index = $total_posts > 1 ? 1 : 0;
$current_post = isset($posts[$current_index]) ? $posts[$current_index] : null;

if (! $current_post) {
wp_send_json_error(['message' => __('No posts found in series to preview.', 'publishpress-series')]);
wp_send_json_error(['message' => __('No posts found in series to preview.', 'organize-series')]);
}

$previous_post = ($current_index + 1 < $total_posts) ? $posts[$current_index + 1] : null;
Expand Down Expand Up @@ -130,7 +130,7 @@ public static function export_layout()

$post_id = isset($_POST['post_id']) ? (int) $_POST['post_id'] : 0;
if (! $post_id) {
wp_send_json_error(['message' => __('Invalid post ID.', 'publishpress-series')]);
wp_send_json_error(['message' => __('Invalid post ID.', 'organize-series')]);
}

$settings = PPS_Series_Post_Navigation_Utilities::get_post_navigation_settings($post_id);
Expand All @@ -153,12 +153,12 @@ public static function import_layout()
$settings = isset($_POST['settings']) && is_array($_POST['settings']) ? $_POST['settings'] : [];

if (! $post_id || empty($settings)) {
wp_send_json_error(['message' => __('Invalid import data.', 'publishpress-series')]);
wp_send_json_error(['message' => __('Invalid import data.', 'organize-series')]);
}

update_post_meta($post_id, PPS_Series_Post_Navigation_Utilities::META_PREFIX . 'layout_meta_value', $settings);

wp_send_json_success(['message' => __('Settings imported successfully.', 'publishpress-series')]);
wp_send_json_success(['message' => __('Settings imported successfully.', 'organize-series')]);
}

/**
Expand All @@ -170,12 +170,12 @@ public static function reset_layout()

$post_id = isset($_POST['post_id']) ? (int) $_POST['post_id'] : 0;
if (! $post_id) {
wp_send_json_error(['message' => __('Invalid post ID.', 'publishpress-series')]);
wp_send_json_error(['message' => __('Invalid post ID.', 'organize-series')]);
}

$defaults = PPS_Series_Post_Navigation_Utilities::get_default_post_navigation_data($post_id);
update_post_meta($post_id, PPS_Series_Post_Navigation_Utilities::META_PREFIX . 'layout_meta_value', $defaults);

wp_send_json_success(['message' => __('Settings reset to defaults.', 'publishpress-series')]);
wp_send_json_success(['message' => __('Settings reset to defaults.', 'organize-series')]);
}
}
Loading