mardi 2 février 2016

How to loop through admin pages in wordpress?

I am at a loss which method to use. I am simply trying to loop through all the admin pages in the backend of WP. From there I'll check if there's matching meta criteria and then return the results to a custom backend page. But I've searched and can't seem to find any sort of method or other to query it. Appreciate any pointers!



via Chebli Mohamed

WordPress Plugin in codecanyon

I made a WordPress plugin to sell in http://codecanyon.net/ (Envato market). The plugin works fine and there is no error. But codecanyon is saying that it does not fulfill the technical standard codecanyon. I need to know: *What is the standard for the WP plugin of codecanyon *. I need a direction from where I can learn the standard coding for the WP plugin of codecanyon . Please help me and thanks in advance.



via Chebli Mohamed

How to fix PHP Call Undefined error message in custom payment wordpress plugin?

I am making a custom payment wordpress plugin for my local bank. When processing payment I've got error messages such as "Notice Undefined index:....... on line 4" like screenshot below: error message

index.php script from screenshot above

<?php
ini_set('display_errors',1);  error_reporting(E_ALL);
$data = array(
           'MerchantID' => $_POST['MerchantID'],     
            'TransactionID' => $_POST['TransactionID'],   
            'RequestDate' =>  $_POST['RequestDate'], 
            'Amount' => $_POST['Amount'],    
            'CurrencyCode' =>$_POST['CurrencyCode'],   
            'Tax' => $_POST['Tax'],    
            'Signature' => $_POST['Signature'],   
            'Description' =>$_POST['Description'],       
            'CallbackURL' => $_POST['CallbackURL'], 
            'UserSession'  => $_POST['UserSession'],   
            'TransactionNote' => $_POST['TransactionNote']  
);

$url_send ="http://ift.tt/1PzjUhK";
$str_data = json_encode($data);

function sendPostData($url, $post){
  $ch = curl_init($url);
  $curl_header = array('Accept: application/json', 'Content-Type: application/json');
  curl_setopt($ch, CURLOPT_HTTPHEADER, $curl_header);
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");  
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  $result = curl_exec($ch);
  curl_close($ch);  // Seems like good practice
  return $result;
}


echo " " . sendPostData($url_send, $str_data);

?>

For detail please try this product and using BCA sakuku as payment option like screenshot below: bca sakuku payment option

And its weird because these plugin working like charm in localhost not in dev.galerigadget.com

How I can fix it?

Cheers



via Chebli Mohamed

Wordpress - Code Snippet Library not working on my theme

Hi I am working on a new Wordpress blog and it for code tutorials so it's very important to have code snippets in it , I tried many plugins but I comfortable with Code Snippet Library

The issue is it's not working on my custom theme I tried twenty fifteen, twenty fourteen and twenty thirteen and it work great on all of them,

How I know the part in my theme that conflict with the plugin, or what I have to add to my theme to support this plugin.

Sorry for my poor explanation but I am new to Wordpress



via Chebli Mohamed

lundi 1 février 2016

Cannot get vars displayed in my 'template' using Handlebars.js correctly

I have a Handlebars script that I am trying to get to iterate through an object to my 'template' below. Even though I can see the 'badNodes' in the object (an object when i do a console.log(row) it doesn't ever pass to the template and all I see is a blank entry next to address in the view/template.

Can anyone suggest what I may have done wrong - P.S I am new to Handlebars.js

<script class="template" type="text/html">
    <div class="badNodesContainer">
        {{#row}}
        <div class="hash{{badNodes.hash}} help-tip">
            <p>
                <strong>Address: </strong>{{badNodes.address}}</br>
            </p>
        </div>
        {{/row}}
    </div>
</script>

// latter part of ajax request

    .done(function (data, result, jqXHR) {
        var checkinData = JSON.parse(data).data;
        var rows = [];

        //_.templateSettings.variable = "badNode";
        var source = $("script.template").html();
        var template = Handlebars.compile(source);

        $.each(checkinData, function (index, row) {
                row.badNodesHTML = "";
                var AB_action_login = '<a class="btn btn-default btn-sm" style="width:70px;text-align:left;" target="_blank" href="http://ift.tt/1UDi11H' + row.user + '&hash=' + row.signature + '"><i class="fa fa-external-link"></i> App</a>';
                if (row.postid == null) {
                    var AB_action_order = '<a class="btn btn-default btn-sm hidden" disabled="disabled" style="width:70px;text-align:left;" target="_blank" href="http://ift.tt/1PQ6y0U' + row.postid + '&action=edit"><i class="fa fa-external-link"></i> Order</a>';
                } else {
                    var AB_action_order = '<a class="btn btn-default btn-sm" style="width:70px;text-align:left;" target="_blank" href="http://ift.tt/1PQ6y0U' + row.postid + '&action=edit"><i class="fa fa-external-link"></i> Order</a>';
                }
                row.AB_login = AB_action_login;
                row.AB_order = AB_action_order;
                row.AB_actions = AB_action_login + AB_action_order;

                if (row.badNodes.length) {
                    $.each(row.badNodes, function (idx, badNode) {
                        badNode.address.toString()
                        badNode.address = /:(.+)/.exec(badNode.address)[1];
                        row.badNodesHTML += template(badNode);
                        row.AB_actions;
                    });
                }
            }
        );



via Chebli Mohamed

Unable to upload image using the Wordpress admin 'Insert Media' option

I am running WordPress 4.3 and in the admin I am no longer able to upload images using the standard upload image tool. I am taking over a project from another developer so don't know exactly what he/she has changed.

The 'Insert Media' box pops up, however when I click the 'Select Files' nothing happens. I would expect it to browse to a folder on my PC to allow an image upload. There are no console log errors and I cannot see the best way to debug this - can anyone suggest my next step to debug this?



via Chebli Mohamed

How to attach a file to user profile in wordpress

I am working on a medical reporting site in wordpress, where the requirement is that admin can upload a seperate .pdf file to different users' profile & only the profile owner can download it.

I have moderate knowledge in wordpress.



via Chebli Mohamed