Support » Plugin: Smart Custom 404 error page [404page] » BUG: New settings option breaks compatibility

  • Resolved Aurovrata Venet

    (@aurovrata)


    Hello,

    first of all thank you for a nice plugin. I have been using it for multiple projects till date without any issues.

    A year ago I developed a multilingual RESTful theme for a client, and this required retrieving the page ID for the 404 page created by the user. The page ID is required to get its translations as well as identification of 404 status in a REST request.

    To do so, I retrieved the page ID from the plugin settings,

    $page404id = get_option( '404page_page_id', 0 );
    

    however, the settings option key and structure are now changed in the latest version, requiring me to do this instead,

    $page404_settings = get_option( '404page_settings', array() );
    $page404id = 0;
    		if(isset($page404_settings['page_id'])) $page404id = $page404_settings['page_id'];

    Can you please ensure future compatibility for plugin/themes that rely on this plugin, by ensuring the structure does not change?

    If you need to change, I would recommend maintaining 2 parallel structures and using the deprecated methodology to notify developers of the change for a few versions updates until developers have had time to upgrade their code.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Peter Raschendorfer

    (@petersplugins)

    It was never intended that the internal functions would be used externally. Therefore I do not take any consideration for compatibility.

    In version 11.1.0, I’ve introduced two new functions: pp_404_get_page_id() and pp_404_get_all_page_ids(). Please use these functions. More information can be found in Developers section of the manual.

    Please let me know if I can mark this as resolved.

    Thread Starter Aurovrata Venet

    (@aurovrata)

    Hi Peter,

    thank you for your answers. I will make use of the above mentioned functions to get the page IDs from now on.

    I have marked this as resolved too.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘BUG: New settings option breaks compatibility’ is closed to new replies.