Skip to content

Some fixes for PHP7 environment #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion MF_thumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
class mfthumb{

function mfthumb(){
function __construct(){
require_once(ABSPATH."/wp-admin/includes/image.php");
require_once(ABSPATH."/wp-includes/media.php");
}
Expand Down
2 changes: 1 addition & 1 deletion admin/mf_ajax_call.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function resolve($data){
public function mf_sort_field($data){
if ( !empty( $data['order'] ) && !empty( $data['group_id'] ) ) {
$order = $data['order'];
$order = split(',',$order);
$order = explode(',',$order);
array_walk( $order, create_function( '&$v,$k', '$v = str_replace("order_","",$v);' ));

if( $thing = mf_custom_fields::save_order_field( $data['group_id'], $order ) ) {
Expand Down
15 changes: 13 additions & 2 deletions mf_front_end.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,18 @@ function get_label($field_name,$post_id=NULL){
*/
function create_image($options){
global $post,$mf_domain;


//correct init
$field_name = '';
$group_index = 1;
$field_index = 1;
$param = NULL;
$attr = NULL;
$post_id = NULL;
$tag_img = true;
$wp_size = 'original';


// establish the default values, then override them with
// whatever the user has passed in
$options = array_merge(
Expand Down Expand Up @@ -456,7 +467,7 @@ function _processed_value($value, $type, $options = array(), $image_array = 0 ){
$options= unserialize( $options );
}

$result = '';
$result = array();
switch($type){
case 'audio':
case 'file':
Expand Down