Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7613341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:07:55+00:00 2026-05-31T02:07:55+00:00

$actions = array( ‘EDIT’ => sprintf(‘<a href=admin-ajax.php?action=%s&subaction=%s&course_id=%d class=%s id=%s>Edit</a>’, ‘abf_cm’, ‘edit_course’, $item[‘course_id’], ‘thickbox edit-box’,

  • 0
$actions = array(
    'EDIT'   => sprintf('<a href="admin-ajax.php?action=%s&subaction=%s&course_id=%d" class="%s" id="%s">Edit</a>',
                    'abf_cm',
                    'edit_course',
                    $item['course_id'],
                    'thickbox edit-box',
                    'edit_'.$item['course_id']
                    ),
    'DELETE'    => sprintf('<a href="?page=%s&task=%s&action=%s&bookid=%s&noheader=true">Delete</a>','course_management','do_process','delete',$item['course_id']),
);

In doing so, the edit part is not being displayed.Am i doing anything wrong.
I also tried using the placeholders

'EDIT'   => sprintf('<a href="admin-ajax.php?action=%1$s&subaction=%2$s&course_id=%4$d" class="%4$s" id="%5$s">Edit</a>',
                    'abf_cm',
                    'edit_course',
                    $item['course_id'],
                    'thickbox edit-box',
                    'edit_'.$item['course_id']
                    ),

but still no results. I also noticed that when i remove the class and id attributes in the earlier version, then it works fine.

Can you please give me a satisfactory explanation of this and tell me where am i doing wrong.

EDIT:

Im using this inside WordPress for creating custom table using WP_List_Table class

    function column_course_name($item ) {

    //Build row actions
    $actions = array(
        'EDIT'      => sprintf('<a href="admin-ajax.php?action=%s&subaction=%s&course_id=%d" class="%s" id="%s">Edit</a>',
                        'abf_cm',
                        'edit_course',
                        $item['course_id'],
                        'thickbox edit-box',
                        'edit_'.$item['course_id']
                        ),
        'DELETE'    => sprintf('<a href="?page=%s&task=%s&action=%s&bookid=%s&noheader=true">Delete</a>','book_management','do_process','delete',$item['course_id']),
    );

    //Return the title contents
    return sprintf('<a href="?page=book_management&action=viewnedit&bookid=%2$s">%1$s</a>%3$s',
        /*$1%s*/ strlen($item['course_name'])>0?$item['course_name']:'<span style="color:silver">(No Name)</span>',
        /*$2%s*/ $item['course_id'],
        /*$3%s*/ $this->row_actions($actions) //row_actions is a method in this class
    ); 
}

update:
Well, its strange to mention but the code works when i use a single class( ie when i delete the space between the two classes for the tag) .

Any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:07:57+00:00Added an answer on May 31, 2026 at 2:07 am

    Dipesh, maybe you have errors in the code around this snippet.

    Try to check your code in isolation. I copied your code to the separate .php script with little set-up and checked $actions array with print_r, like this:

    edit_array.php

    <?php
    $item = array();
    $item['course_id'] = 1;
    $actions = array(
        'EDIT'   => sprintf('<a href="admin-ajax.php?action=%s&subaction=%s&course_id=%d" class="%s" id="%s">Edit</a>',
            'abf_cm',
            'edit_course',
            $item['course_id'],
           'thickbox edit-box',
           'edit_'.$item['course_id']
         ),
        'DELETE'    => sprintf('<a href="?page=%s&task=%s&action=%s&bookid=%s&noheader=true">Delete</a>','course_management','do_process','delete',$item['course_id']),
    );
    
    print_r($actions);
    

    I ran this script from console and got the following results:

    $ php edit_array.php 
    Array
    (
        [EDIT] => <a href="admin-ajax.php?action=abf_cm&subaction=edit_course&course_id=1" class="thickbox edit-box" id="edit_1">Edit</a>
        [DELETE] => <a href="?page=course_management&task=do_process&action=delete&bookid=1&noheader=true">Delete</a>
    )
    

    Generated link for $actions['EDIT'] is HTML valid, so one can safely conclude that your code itself is working fine, and error lies somewhere else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've set this in my AppController.php $this->Auth->authorize = array( 'Actions' => array( 'actionPath' =>
I need to get string array or list with ajax and Action, this is
I created the following interface: <?php interface Action { public function execute(\requests\Request $request, array
My routes.php has the following line of code: Router::connect('/', array('controller' => 'users', 'action' =>
i have this code in actions.class.php public function executeListmatches(sfWebRequest $request) { $form_values = $request->getParameter('match_form',
I have this form: $form = array( '<form name=backup-form class=backup-form method=post action=#>', '<fieldset class=backup-fields>',
I have a Form element: $Form=new Zend_Form; $Form->setAction($this->view->url(array('controller'=>'auth','action'=>'create'),null,true)) ->setMethod('post') ->setAttrib('id','auth-form') ->removeAttrib('enctype'); As can be
I have a url http:// * .com/branch/module/view/id/1/cat/2/etc/3. It becomes. array ( 'module'=>'branch', 'controller'=>'module', 'action'=>'view'
I register class methods for actions in my Wordpress plugin. When my method gets
I have an array of permissions: array( array( controller => somewhere, action => ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.