Support » Plugin: Transposh WordPress Translation » custom widgets > preserved after plugin updates?

  • Resolved guidobras


    I’m planning to write a custom widget to display languages names as iso codes (i.e. en, fr, it…) and without flags

    I’ve found the documentation to write a custom widget here:

    Just wanted to ask advice about preserving custom widgets when updating transposh (using wordpress plugin update functionality)

    Many thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Ofer Wald


    Hi Guido,

    You may place your widgets in the wp-content/uploads/transposh/widgets directory – where they will be protected from upgrades.

    Good luck

    Many thanks Ofer

    I’m sorry but my custom widget is not loaded when I save it in the directory:
    the default widget appears instead.

    It works perfectly when I save it in
    Unfortunately it is not protected from updates there.

    I’ve named the widget file “tpw_list_with_iso_codes.php”

    This is the line of code that calls the custom widget in my theme (the above php file is placed inside the “iso_codes” dir)
    if(function_exists("transposh_widget")) { transposh_widget(array(), array('title' => '', 'widget_file' => 'iso_codes/tpw_list_with_iso_codes.php'));}?>

    This is the content of the file

      Plugin Name: List with iso codes
      Plugin URI:
      Description: Widget with languages ISO codes
      Author: GB
      Version: 1.0
      Author URI:
     * Transposh v1.0.4.1
     * Copyright 2018, Team Transposh
     * Licensed under the GPL Version 2 or higher.
     * Date: Mon, 31 Dec 2018 13:56:20 +0200
    class tpw_list_with_iso_codes extends transposh_base_widget {
       * Creates the list of iso codes
       * @global transposh_plugin $my_transposh_plugin
       * @param array $args -
      static function tp_widget_do($args) {
          echo "<div class=\"" . NO_TRANSLATE_CLASS . " transposh_iso_codes\" >";
          echo "<ul>";
          foreach ($args as $langrecord) {
              echo "<li> <a href=\"{$langrecord['url']}\"" . ($langrecord['active'] ? ' class="tr_active"' : '' ) . '>' . 
              "{$langrecord['isocode']} </a> </li>";
          echo "</ul>";
          echo "</div>";

    Please do you see anything wrong in my code or setup?

    Many thanks

    • This reply was modified 4 months, 4 weeks ago by  guidobras.
    • This reply was modified 4 months, 4 weeks ago by  guidobras.
    Plugin Author Ofer Wald



    First, you must be using the full version. Not supported on the version, but since I see I think that you already have this,

    Just make sure that the webserver user has permission for that directory, I suggest placing the code in a sub directory

    You can test that its working by copying the current widgets to that directory, they should be listed with a (*) in the widget appearance selection box

    Good luck,

    I’m a bit confused by the “full version” concept.

    A few days ago I was given this website to mantain, and it had transposh plugin v installed. As part of a normal maintenance plan, using wordpress (.org) update I updated the plugin to the latest version available, as a result now I have

    Am I on the full version now? I think so, because of the .1 at the end.

    Should I reinstall after downloading it from the transposh website?
    If so it’s very important for me to preserve existing settings and translations.

    As for the webserver setup it looks fine:
    the uploads/transposh/widget dir is owned by the webserver user and has 0755 permissions
    if I put a test file in the same dir of my custom widget, I can see it using a web browser on a client.

    Thanks again

    • This reply was modified 4 months, 4 weeks ago by  guidobras.
    Plugin Author Ofer Wald


    Yes, it seems like you are on the last full version,

    Is the widget file inside a directory in the uploads/transposh/widgets (mind the s) dir? or is it just there, both should work, but I rarely tested the dirless method

    Did you try copying a current widget there?

    The custom widget is inside a dir:


    Yes, I uploaded some current widgets to that directory, but I could not find “the widget appearance selection box” to check for the asterisk you mentioned. Where is that selection box supposed to appear?

    • This reply was modified 4 months, 4 weeks ago by  guidobras.
    Plugin Author Ofer Wald


    Please contact me via the form, its getting late here so I will only be able to get back to you in a few hours, this should have worked, but I don’t know.

    After contact we’ll try and setup a debug session to make this work

    As I’m trying to write a custom plugin as well, and chance you can explain what is going on? I’ve having the exact same problem. My custom widget is not loading. I tried putting in one of the existing widgets, but they don’t show up with * either. Do I need to do anything other than putting the widget .php file in the correct directory?

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.