inc/update.php

largo_activation_maybe_setup()

For initial activations of Largo, where no largo was previously installed

Since:0.5.5
Returns:Bool $alse if the initial setup functions were not run, true if they were.
Link:https://github.com/INN/Largo/issues/690
largo_perform_update()

Performs various update functions and set a new verion number.

This acts as a main() for applying database updates when the update ajax is called.

Since:0.3
largo_version()

Returns current version of largo as set in stylesheet.

Since:0.3
largo_need_updates()

Checks if updates need to be run.

Since:0.3
Returns:boolean $result True if updates need to be run
largo_home_transition()

Convert old theme option of ‘homepage_top’ to new option of ‘home_template’

Since:0.4
largo_update_widgets()

Puts new widgets into sidebars as appropriate based on old theme options

Since:0.4
largo_update_prominence_term_descriptions()

Updates post prominence term descriptions iff they use the old language

This function can be added to the init action to force an update of prominence term descriptions:
add_action(‘init’, ‘largo_update_prominence_term_descriptions’);

This function does not touch custom prominence term descriptions, except those that are identical to the descriptions of current or 0.3 prominence term descriptions.

Since:0.4
Uses:largo_update_prominence_term_description_single
largo_update_prominence_term_description_single()

Compares an array containing an old and new prominence term description and the appropriate slug and name to an array of current term descriptions. For each term whose current description matches the old description, the function updates the current description to the new description.

This function contains commented-out logic that will allow you to from description to olddescription

Since:

0.4

Parameters:
  • $update (array) – The new details for the prominence tax term to be updated
  • $term_descriptions (array) – Array of prominence terms, each prominence term as an associative array with keys: name, description, olddescription, slug
Uses:

wp_update_term

Uses:

clean_term_cache

largo_force_settings_update()

Update miscellaneous settings

Since:0.4
largo_enable_if_series()

Enable series if series have been created.

Since:0.4
Returns:boolean $result True if series were enabled by this function
largo_enable_series_if_landing_page()

Enable the series taxonomy if the series landing pages are in use.

Since:0.4
Returns:boolean $result If series landing pages (and series) were enabled by this function.
largo_remove_topstory_prominence_term()

Remove “top-story” prominence term to avoid conflicts with homepages that will register it

Returns:array $results Deleted prominence terms
largo_set_new_option_defaults()

Save default values for any newly introduced options to the database

Note: this must be called before any other update function calls of_set_option, as of_set_uption defaults all values to null.

Since:0.5.1
largo_update_custom_less_variables()

Make sure custom CSS is regenerated if we’re using custom LESS variables

largo_replace_deprecated_widgets()

Replace deprecated widgets with new widgets

To add widgets to this list of widgets to be upgraded:
  • Add the deprecated widget class and its replacement to $upgrades
Uses:largo_get_widget_basename
Uses:largo_get_widget_number
Since:0.5.3

Callback for updating the Largo Featured widget in largo_replace_deprecated_widgets()

Since:

0.5.3

See:

largo_replace_deprecated_widgets

Parameters:
  • $deprecated (array) – the deprecated widget’s $instance variables
  • $replacement (array) – the replacement widget’s $instance variables
Returns:

array $result the replacement widget’s $instance variables

largo_widget_in_region()

Checks to see if a given widget is in a given region already

Since:0.5.2
Returns:boolean $result Whether or not the widget was found.
largo_instantiate_widget()

Inserts a widget programmatically. This is slightly dangerous as it makes some assumptions about existing plugins if $instance_settings are wrong, bad things might happen

Since:

0.5

Parameters:
  • $kind. (string) – Kind of widget to instantiate.
  • $instance_settings. (array) – Settings for that array.
  • $region. (string) – Sidebar region to add to.
Returns:

array $result array(‘id’ => the id with number of the new widget , ‘place’ => the index of the id in its region )

largo_get_widget_basename()

Utility function to get the basename of a widget from the widget’s slug

Since:0.5.3
largo_get_widget_number()

Utility function to get the number of a widget from the widget’s slug

Since:0.5.3
largo_update_admin_notice()

Add an admin notice if largo needs to be updated.

Since:0.3
largo_register_update_page()

Register an admin page for updates.

Since:0.3
largo_update_page_view()

DOM for admin page for updates.

Since:0.3
largo_update_page_enqueue_js()

Enqueues javascript used on the Largo Update page

Since:0.3
Global:LARGO_DEBUG
Global:$_GET
largo_ajax_update_database()

Ajax handler for when update is applied from the updates page.

Since:0.3
Global:LARGO_DEBUG
Global:$_GET
class LargoPreviousOptions

A singleton utility class for preserving and retrieving previous Largo options

since:0.5.3
preserve()

Call this method before saving theme options for the first time after updating Largo to preserve the state of theme options for the previous version.

retrieve()

Retrieve the theme options for the version of Largo that immediately preceeded the currently-deployed version.

Optionally, retrieve a previous set of theme options by passing a version string to the method.

Parameters:
  • $largo_version (string) – for example ‘0.5.2’
largo_preserve_previous_options()

Convenience function for storing the theme options for the version of the theme that immediately preceeded the currently-deployed version.

Since:0.5.3
largo_retrieve_previous_options()

Convenience function for retrieving the theme options for the version of the theme that immediately preceeded the currently-deployed version.

Since:0.5.3
largo_block_theme_options_for_update()

If Largo needs to be updated, prevent the user from access the Theme Options edit page.

Since:0.5.3
largo_block_theme_options()

Displays a message indicating the user should update their Largo install before attempting to edit Theme Options

Since:0.5.3