Skip to content
Merged
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
16 changes: 16 additions & 0 deletions classes/controllers/FrmFormActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,22 @@ public static function limit_by_type( $where ) {

return $where;
}

/**
* Prevent WPML from filtering form actions based on the active language.
*
* @since x.x
*
* @param bool|null $null
* @param string $post_type
* @return bool|null
*/
public static function prevent_wpml_translations( $null, $post_type ) {
if ( self::$action_post_type === $post_type ) {
return false;
}
return $null;
}
}

class Frm_Form_Action_Factory {
Expand Down
1 change: 1 addition & 0 deletions classes/controllers/FrmHooksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public static function load_hooks() {
// Form Actions Controller.
add_action( 'init', 'FrmFormActionsController::register_post_types', 1 );
add_action( 'frm_after_create_entry', 'FrmFormActionsController::trigger_create_actions', 20, 3 );
add_filter( 'pre_wpml_is_translated_post_type', 'FrmFormActionsController::prevent_wpml_translations', 10, 2 );
Comment thread
Crabcyborg marked this conversation as resolved.

// Forms Controller.
add_action( 'widgets_init', 'FrmFormsController::register_widgets' );
Expand Down