Not a developer? Go to MovableType.com

Documentation

Plugin Callbacks

saveconfigfilter

<p>A new <strong>save_config_filter</strong> callback was added in Movable Type 5.13. This callback is triggered before the plugin settings are saved. The plugin developers can use this callback to validate the values in the settings. If the callback returns <strong>true</strong>, the system saves the plugin settings. If the callback returns <strong>false</strong>, the system does not save the settings. Use $app-&gt;error to set the error message.</p>

<pre class="prettyprint"><code class="language-perl">sub save_config_filter($cb, $plugin, $data, $scope)

{ if ($data->{combination} ne ‘777’) { $plugin->error("Sorry, wrong combination"); return 0; } return 1; }

<ul>
  <li><strong>$cb</strong><br />Callback object.</li>
  <li><strong>$plugin</strong> <br />Plugin object(ID).</li>
  <li><strong>$data</strong> <br />Hashed strings of the plugin settings. The key is the setting name, and the value is the input value.</li>
  <li><strong>$scope</strong><br />Scope of the plugin, system or blog.</li>
</ul>

Back

Leave a Comment