💎 PREMIUM: Changeset/ - Collection

Changeset 2474185


Ignore:
Timestamp:
02/13/2021 10:07:37 AM (5 years ago)
Author:
kuroit
Message:

plugin v1.1.1 changes

Location:
advanced-admin-search/trunk
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • advanced-admin-search/trunk/LICENSE

    r2207029 r2474185  
    11                    GNU GENERAL PUBLIC LICENSE
     2
     3
    24                       Version 2, June 1991
    35
     6
     7
     8
     9
    410 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
     11
     12
    513 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
     14
     15
    616 Everyone is permitted to copy and distribute verbatim copies
     17
     18
    719 of this license document, but changing it is not allowed.
    820
     21
     22
     23
     24
    925                            Preamble
    1026
     27
     28
     29
     30
    1131  The licenses for most software are designed to take away your
     32
     33
    1234freedom to share and change it.  By contrast, the GNU General Public
     35
     36
    1337License is intended to guarantee your freedom to share and change free
     38
     39
    1440software--to make sure the software is free for all its users.  This
     41
     42
    1543General Public License applies to most of the Free Software
     44
     45
    1646Foundation's software and to any other program whose authors commit to
     47
     48
    1749using it.  (Some other Free Software Foundation software is covered by
     50
     51
    1852the GNU Lesser General Public License instead.)  You can apply it to
     53
     54
    1955your programs, too.
    2056
     57
     58
     59
     60
    2161  When we speak of free software, we are referring to freedom, not
     62
     63
    2264price.  Our General Public Licenses are designed to make sure that you
     65
     66
    2367have the freedom to distribute copies of free software (and charge for
     68
     69
    2470this service if you wish), that you receive source code or can get it
     71
     72
    2573if you want it, that you can change the software or use pieces of it
     74
     75
    2676in new free programs; and that you know you can do these things.
    2777
     78
     79
     80
     81
    2882  To protect your rights, we need to make restrictions that forbid
     83
     84
    2985anyone to deny you these rights or to ask you to surrender the rights.
     86
     87
    3088These restrictions translate to certain responsibilities for you if you
     89
     90
    3191distribute copies of the software, or if you modify it.
    3292
     93
     94
     95
     96
    3397  For example, if you distribute copies of such a program, whether
     98
     99
    34100gratis or for a fee, you must give the recipients all the rights that
     101
     102
    35103you have.  You must make sure that they, too, receive or can get the
     104
     105
    36106source code.  And you must show them these terms so they know their
     107
     108
    37109rights.
    38110
     111
     112
     113
     114
    39115  We protect your rights with two steps: (1) copyright the software, and
     116
     117
    40118(2) offer you this license which gives you legal permission to copy,
     119
     120
    41121distribute and/or modify the software.
    42122
     123
     124
     125
     126
    43127  Also, for each author's protection and ours, we want to make certain
     128
     129
    44130that everyone understands that there is no warranty for this free
     131
     132
    45133software.  If the software is modified by someone else and passed on, we
     134
     135
    46136want its recipients to know that what they have is not the original, so
     137
     138
    47139that any problems introduced by others will not reflect on the original
     140
     141
    48142authors' reputations.
    49143
     144
     145
     146
     147
    50148  Finally, any free program is threatened constantly by software
     149
     150
    51151patents.  We wish to avoid the danger that redistributors of a free
     152
     153
    52154program will individually obtain patent licenses, in effect making the
     155
     156
    53157program proprietary.  To prevent this, we have made it clear that any
     158
     159
    54160patent must be licensed for everyone's free use or not licensed at all.
    55161
     162
     163
     164
     165
    56166  The precise terms and conditions for copying, distribution and
     167
     168
    57169modification follow.
    58170
     171
     172
     173
     174
    59175                    GNU GENERAL PUBLIC LICENSE
     176
     177
    60178   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    61179
     180
     181
     182
     183
    62184  0. This License applies to any program or other work which contains
     185
     186
    63187a notice placed by the copyright holder saying it may be distributed
     188
     189
    64190under the terms of this General Public License.  The "Program", below,
     191
     192
    65193refers to any such program or work, and a "work based on the Program"
     194
     195
    66196means either the Program or any derivative work under copyright law:
     197
     198
    67199that is to say, a work containing the Program or a portion of it,
     200
     201
    68202either verbatim or with modifications and/or translated into another
     203
     204
    69205language.  (Hereinafter, translation is included without limitation in
     206
     207
    70208the term "modification".)  Each licensee is addressed as "you".
    71209
     210
     211
     212
     213
    72214Activities other than copying, distribution and modification are not
     215
     216
    73217covered by this License; they are outside its scope.  The act of
     218
     219
    74220running the Program is not restricted, and the output from the Program
     221
     222
    75223is covered only if its contents constitute a work based on the
     224
     225
    76226Program (independent of having been made by running the Program).
     227
     228
    77229Whether that is true depends on what the Program does.
    78230
     231
     232
     233
     234
    79235  1. You may copy and distribute verbatim copies of the Program's
     236
     237
    80238source code as you receive it, in any medium, provided that you
     239
     240
    81241conspicuously and appropriately publish on each copy an appropriate
     242
     243
    82244copyright notice and disclaimer of warranty; keep intact all the
     245
     246
    83247notices that refer to this License and to the absence of any warranty;
     248
     249
    84250and give any other recipients of the Program a copy of this License
     251
     252
    85253along with the Program.
    86254
     255
     256
     257
     258
    87259You may charge a fee for the physical act of transferring a copy, and
     260
     261
    88262you may at your option offer warranty protection in exchange for a fee.
    89263
     264
     265
     266
     267
    90268  2. You may modify your copy or copies of the Program or any portion
     269
     270
    91271of it, thus forming a work based on the Program, and copy and
     272
     273
    92274distribute such modifications or work under the terms of Section 1
     275
     276
    93277above, provided that you also meet all of these conditions:
    94278
     279
     280
     281
     282
    95283    a) You must cause the modified files to carry prominent notices
     284
     285
    96286    stating that you changed the files and the date of any change.
    97287
     288
     289
     290
     291
    98292    b) You must cause any work that you distribute or publish, that in
     293
     294
    99295    whole or in part contains or is derived from the Program or any
     296
     297
    100298    part thereof, to be licensed as a whole at no charge to all third
     299
     300
    101301    parties under the terms of this License.
    102302
     303
     304
     305
     306
    103307    c) If the modified program normally reads commands interactively
     308
     309
    104310    when run, you must cause it, when started running for such
     311
     312
    105313    interactive use in the most ordinary way, to print or display an
     314
     315
    106316    announcement including an appropriate copyright notice and a
     317
     318
    107319    notice that there is no warranty (or else, saying that you provide
     320
     321
    108322    a warranty) and that users may redistribute the program under
     323
     324
    109325    these conditions, and telling the user how to view a copy of this
     326
     327
    110328    License.  (Exception: if the Program itself is interactive but
     329
     330
    111331    does not normally print such an announcement, your work based on
     332
     333
    112334    the Program is not required to print an announcement.)
    113335
     336
     337
     338
     339
    114340These requirements apply to the modified work as a whole.  If
     341
     342
    115343identifiable sections of that work are not derived from the Program,
     344
     345
    116346and can be reasonably considered independent and separate works in
     347
     348
    117349themselves, then this License, and its terms, do not apply to those
     350
     351
    118352sections when you distribute them as separate works.  But when you
     353
     354
    119355distribute the same sections as part of a whole which is a work based
     356
     357
    120358on the Program, the distribution of the whole must be on the terms of
     359
     360
    121361this License, whose permissions for other licensees extend to the
     362
     363
    122364entire whole, and thus to each and every part regardless of who wrote it.
    123365
     366
     367
     368
     369
    124370Thus, it is not the intent of this section to claim rights or contest
     371
     372
    125373your rights to work written entirely by you; rather, the intent is to
     374
     375
    126376exercise the right to control the distribution of derivative or
     377
     378
    127379collective works based on the Program.
    128380
     381
     382
     383
     384
    129385In addition, mere aggregation of another work not based on the Program
     386
     387
    130388with the Program (or with a work based on the Program) on a volume of
     389
     390
    131391a storage or distribution medium does not bring the other work under
     392
     393
    132394the scope of this License.
    133395
     396
     397
     398
     399
    134400  3. You may copy and distribute the Program (or a work based on it,
     401
     402
    135403under Section 2) in object code or executable form under the terms of
     404
     405
    136406Sections 1 and 2 above provided that you also do one of the following:
    137407
     408
     409
     410
     411
    138412    a) Accompany it with the complete corresponding machine-readable
     413
     414
    139415    source code, which must be distributed under the terms of Sections
     416
     417
    140418    1 and 2 above on a medium customarily used for software interchange; or,
    141419
     420
     421
     422
     423
    142424    b) Accompany it with a written offer, valid for at least three
     425
     426
    143427    years, to give any third party, for a charge no more than your
     428
     429
    144430    cost of physically performing source distribution, a complete
     431
     432
    145433    machine-readable copy of the corresponding source code, to be
     434
     435
    146436    distributed under the terms of Sections 1 and 2 above on a medium
     437
     438
    147439    customarily used for software interchange; or,
    148440
     441
     442
     443
     444
    149445    c) Accompany it with the information you received as to the offer
     446
     447
    150448    to distribute corresponding source code.  (This alternative is
     449
     450
    151451    allowed only for noncommercial distribution and only if you
     452
     453
    152454    received the program in object code or executable form with such
     455
     456
    153457    an offer, in accord with Subsection b above.)
    154458
     459
     460
     461
     462
    155463The source code for a work means the preferred form of the work for
     464
     465
    156466making modifications to it.  For an executable work, complete source
     467
     468
    157469code means all the source code for all modules it contains, plus any
     470
     471
    158472associated interface definition files, plus the scripts used to
     473
     474
    159475control compilation and installation of the executable.  However, as a
     476
     477
    160478special exception, the source code distributed need not include
     479
     480
    161481anything that is normally distributed (in either source or binary
     482
     483
    162484form) with the major components (compiler, kernel, and so on) of the
     485
     486
    163487operating system on which the executable runs, unless that component
     488
     489
    164490itself accompanies the executable.
    165491
     492
     493
     494
     495
    166496If distribution of executable or object code is made by offering
     497
     498
    167499access to copy from a designated place, then offering equivalent
     500
     501
    168502access to copy the source code from the same place counts as
     503
     504
    169505distribution of the source code, even though third parties are not
     506
     507
    170508compelled to copy the source along with the object code.
    171509
     510
     511
     512
     513
    172514  4. You may not copy, modify, sublicense, or distribute the Program
     515
     516
    173517except as expressly provided under this License.  Any attempt
     518
     519
    174520otherwise to copy, modify, sublicense or distribute the Program is
     521
     522
    175523void, and will automatically terminate your rights under this License.
     524
     525
    176526However, parties who have received copies, or rights, from you under
     527
     528
    177529this License will not have their licenses terminated so long as such
     530
     531
    178532parties remain in full compliance.
    179533
     534
     535
     536
     537
    180538  5. You are not required to accept this License, since you have not
     539
     540
    181541signed it.  However, nothing else grants you permission to modify or
     542
     543
    182544distribute the Program or its derivative works.  These actions are
     545
     546
    183547prohibited by law if you do not accept this License.  Therefore, by
     548
     549
    184550modifying or distributing the Program (or any work based on the
     551
     552
    185553Program), you indicate your acceptance of this License to do so, and
     554
     555
    186556all its terms and conditions for copying, distributing or modifying
     557
     558
    187559the Program or works based on it.
    188560
     561
     562
     563
     564
    189565  6. Each time you redistribute the Program (or any work based on the
     566
     567
    190568Program), the recipient automatically receives a license from the
     569
     570
    191571original licensor to copy, distribute or modify the Program subject to
     572
     573
    192574these terms and conditions.  You may not impose any further
     575
     576
    193577restrictions on the recipients' exercise of the rights granted herein.
     578
     579
    194580You are not responsible for enforcing compliance by third parties to
     581
     582
    195583this License.
    196584
     585
     586
     587
     588
    197589  7. If, as a consequence of a court judgment or allegation of patent
     590
     591
    198592infringement or for any other reason (not limited to patent issues),
     593
     594
    199595conditions are imposed on you (whether by court order, agreement or
     596
     597
    200598otherwise) that contradict the conditions of this License, they do not
     599
     600
    201601excuse you from the conditions of this License.  If you cannot
     602
     603
    202604distribute so as to satisfy simultaneously your obligations under this
     605
     606
    203607License and any other pertinent obligations, then as a consequence you
     608
     609
    204610may not distribute the Program at all.  For example, if a patent
     611
     612
    205613license would not permit royalty-free redistribution of the Program by
     614
     615
    206616all those who receive copies directly or indirectly through you, then
     617
     618
    207619the only way you could satisfy both it and this License would be to
     620
     621
    208622refrain entirely from distribution of the Program.
    209623
     624
     625
     626
     627
    210628If any portion of this section is held invalid or unenforceable under
     629
     630
    211631any particular circumstance, the balance of the section is intended to
     632
     633
    212634apply and the section as a whole is intended to apply in other
     635
     636
    213637circumstances.
    214638
     639
     640
     641
     642
    215643It is not the purpose of this section to induce you to infringe any
     644
     645
    216646patents or other property right claims or to contest validity of any
     647
     648
    217649such claims; this section has the sole purpose of protecting the
     650
     651
    218652integrity of the free software distribution system, which is
     653
     654
    219655implemented by public license practices.  Many people have made
     656
     657
    220658generous contributions to the wide range of software distributed
     659
     660
    221661through that system in reliance on consistent application of that
     662
     663
    222664system; it is up to the author/donor to decide if he or she is willing
     665
     666
    223667to distribute software through any other system and a licensee cannot
     668
     669
    224670impose that choice.
    225671
     672
     673
     674
     675
    226676This section is intended to make thoroughly clear what is believed to
     677
     678
    227679be a consequence of the rest of this License.
    228680
     681
     682
     683
     684
    229685  8. If the distribution and/or use of the Program is restricted in
     686
     687
    230688certain countries either by patents or by copyrighted interfaces, the
     689
     690
    231691original copyright holder who places the Program under this License
     692
     693
    232694may add an explicit geographical distribution limitation excluding
     695
     696
    233697those countries, so that distribution is permitted only in or among
     698
     699
    234700countries not thus excluded.  In such case, this License incorporates
     701
     702
    235703the limitation as if written in the body of this License.
    236704
     705
     706
     707
     708
    237709  9. The Free Software Foundation may publish revised and/or new versions
     710
     711
    238712of the General Public License from time to time.  Such new versions will
     713
     714
    239715be similar in spirit to the present version, but may differ in detail to
     716
     717
    240718address new problems or concerns.
    241719
     720
     721
     722
     723
    242724Each version is given a distinguishing version number.  If the Program
     725
     726
    243727specifies a version number of this License which applies to it and "any
     728
     729
    244730later version", you have the option of following the terms and conditions
     731
     732
    245733either of that version or of any later version published by the Free
     734
     735
    246736Software Foundation.  If the Program does not specify a version number of
     737
     738
    247739this License, you may choose any version ever published by the Free Software
     740
     741
    248742Foundation.
    249743
     744
     745
     746
     747
    250748  10. If you wish to incorporate parts of the Program into other free
     749
     750
    251751programs whose distribution conditions are different, write to the author
     752
     753
    252754to ask for permission.  For software which is copyrighted by the Free
     755
     756
    253757Software Foundation, write to the Free Software Foundation; we sometimes
     758
     759
    254760make exceptions for this.  Our decision will be guided by the two goals
     761
     762
    255763of preserving the free status of all derivatives of our free software and
     764
     765
    256766of promoting the sharing and reuse of software generally.
    257767
     768
     769
     770
     771
    258772                            NO WARRANTY
    259773
     774
     775
     776
     777
    260778  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
     779
     780
    261781FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
     782
     783
    262784OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
     785
     786
    263787PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
     788
     789
    264790OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     791
     792
    265793MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
     794
     795
    266796TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
     797
     798
    267799PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
     800
     801
    268802REPAIR OR CORRECTION.
    269803
     804
     805
     806
     807
    270808  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
     809
     810
    271811WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
     812
     813
    272814REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
     815
     816
    273817INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
     818
     819
    274820OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
     821
     822
    275823TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
     824
     825
    276826YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
     827
     828
    277829PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
     830
     831
    278832POSSIBILITY OF SUCH DAMAGES.
    279833
     834
     835
     836
     837
    280838                     END OF TERMS AND CONDITIONS
    281839
     840
     841
     842
     843
    282844            How to Apply These Terms to Your New Programs
    283845
     846
     847
     848
     849
    284850  If you develop a new program, and you want it to be of the greatest
     851
     852
    285853possible use to the public, the best way to achieve this is to make it
     854
     855
    286856free software which everyone can redistribute and change under these terms.
    287857
     858
     859
     860
     861
    288862  To do so, attach the following notices to the program.  It is safest
     863
     864
    289865to attach them to the start of each source file to most effectively
     866
     867
    290868convey the exclusion of warranty; and each file should have at least
     869
     870
    291871the "copyright" line and a pointer to where the full notice is found.
    292872
     873
     874
     875
     876
    293877    <one line to give the program's name and a brief idea of what it does.>
     878
     879
    294880    Copyright (C) <year>  <name of author>
    295881
     882
     883
     884
     885
    296886    This program is free software; you can redistribute it and/or modify
     887
     888
    297889    it under the terms of the GNU General Public License as published by
     890
     891
    298892    the Free Software Foundation; either version 2 of the License, or
     893
     894
    299895    (at your option) any later version.
    300896
     897
     898
     899
     900
    301901    This program is distributed in the hope that it will be useful,
     902
     903
    302904    but WITHOUT ANY WARRANTY; without even the implied warranty of
     905
     906
    303907    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     908
     909
    304910    GNU General Public License for more details.
    305911
     912
     913
     914
     915
    306916    You should have received a copy of the GNU General Public License along
     917
     918
    307919    with this program; if not, write to the Free Software Foundation, Inc.,
     920
     921
    308922    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    309923
     924
     925
     926
     927
    310928Also add information on how to contact you by electronic and paper mail.
    311929
     930
     931
     932
     933
    312934If the program is interactive, make it output a short notice like this
     935
     936
    313937when it starts in an interactive mode:
    314938
     939
     940
     941
     942
    315943    Gnomovision version 69, Copyright (C) year name of author
     944
     945
    316946    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
     947
     948
    317949    This is free software, and you are welcome to redistribute it
     950
     951
    318952    under certain conditions; type `show c' for details.
    319953
     954
     955
     956
     957
    320958The hypothetical commands `show w' and `show c' should show the appropriate
     959
     960
    321961parts of the General Public License.  Of course, the commands you use may
     962
     963
    322964be called something other than `show w' and `show c'; they could even be
     965
     966
    323967mouse-clicks or menu items--whatever suits your program.
    324968
     969
     970
     971
     972
    325973You should also get your employer (if you work as a programmer) or your
     974
     975
    326976school, if any, to sign a "copyright disclaimer" for the program, if
     977
     978
    327979necessary.  Here is a sample; alter the names:
    328980
     981
     982
     983
     984
    329985  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
     986
     987
    330988  `Gnomovision' (which makes passes at compilers) written by James Hacker.
    331989
     990
     991
     992
     993
    332994  <signature of Ty Coon>, 1 April 1989
     995
     996
    333997  Ty Coon, President of Vice
    334998
     999
     1000
     1001
     1002
    3351003This General Public License does not permit incorporating your program into
     1004
     1005
    3361006proprietary programs.  If your program is a subroutine library, you may
     1007
     1008
    3371009consider it more useful to permit linking proprietary applications with the
     1010
     1011
    3381012library.  If this is what you want to do, use the GNU Lesser General
     1013
     1014
    3391015Public License instead of this License.
     1016
     1017
  • advanced-admin-search/trunk/Makefile

    r2207029 r2474185  
    11PLUGIN_FILES = $(shell git ls-files)
     2
     3
     4
     5
    26
    37TARGET = advanced-admin-search.zip
    48
     9
     10
     11
     12
    513$(TARGET): $(PLUGIN_FILES)
     14
     15
    616    zip $(TARGET) $(PLUGIN_FILES)
    717
     18
     19
     20
     21
    822clean:
     23
     24
    925    -$(RM) -r assets/*/node_modules
     26
     27
    1028    -$(RM) *.zip
    1129
     30
     31
     32
     33
    1234.PHONY: clean
     35
     36
  • advanced-admin-search/trunk/README.md

    r2207029 r2474185  
    44Tags: advance search, admin search, custom post type search
    55Requires at least: 3.9
    6 Tested up to: 5.3
    7 Stable tag: 1.1
     6Tested up to: 5.6.1
     7Stable tag: 1.1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5959== Changelog ==
    6060
     61= 1.1.1 =
     62* Bug Fixes
     63* Dedicated search page support
     64* UI Changes
    6165= 1.1 =
    6266* JS bug fix
  • advanced-admin-search/trunk/advanced-admin-search.php

    r2207029 r2474185  
    44 * Plugin URI:        https://www.kuroit.com/product/advanced-admin-search
    55 * Description:       Easily search everything in WordPress admin panel from one single search field.
    6  * Version:           1.1
     6 * Version:           1.1.1
    77 * Author:            Kuroit
    88 * Author URI:        https://www.kuroit.com
     
    1010 * License URI:       http://www.gnu.org/licenses/gpl-2.0.html
    1111 */
     12
    1213 
     14
    1315/* The Advanced Admin Search Plugin
    1416 * Advanced Admin Search is a wordpress plugin which adds extra searching feature into admin bar.
     
    1921
    2022if (!defined('ABSPATH')) {
     23
    2124    die();// Exit if accessed directly
     25
    2226}
     27
     28require_once plugin_dir_path(__FILE__) . 'searchresults.php';
     29
     30require_once plugin_dir_path(__FILE__) . 'menu.php';
    2331
    2432require_once plugin_dir_path(__FILE__) . 'scripts.php';
     
    2634require_once plugin_dir_path(__FILE__) . 'searchbox.php';
    2735
    28 require_once plugin_dir_path(__FILE__) . 'searchresults.php';
     36// Re-direct on plugin activation
    2937
     38add_action( 'activated_plugin',  'Kuroit\AdvancedAdminSearch\AASKP_plugin_activated' );
     39
     40function AASKP_plugin_activated($plugin){
     41
     42    if ( plugin_basename( __FILE__ ) === $plugin ) {
     43
     44        exit( wp_safe_redirect( 'admin.php?page=advanced-admin-search' ) );
     45
     46    }
     47
     48}
    3049
    3150class AASKPadvancedAdminSearch
     51
    3252{
    3353
    3454    public function __construct() // instantiation
     55
    3556    {
    3657
     
    4061
    4162        // get the searching data like admin menu, media labraries, post, pages
     63
    4264        // and Hook to add javascript.
    4365
     
    5375
    5476//fire it up
     77
    5578new AASKPadvancedAdminSearch();
    5679
  • advanced-admin-search/trunk/css/style.css

    r2207029 r2474185  
    11.adminmenu_search li ul{
    2 
    32    position: absolute;
    4 
    53    display: block;
    6 
    7 }
    8 
     4}
    95.advance_search_box {
    10 
    116    width: 150px !important;
    127    height:0px !important;
    13 
    14 }
    15 
     8}
    169.search_list {
    17 
    1810    float: right;
    19 
    2011    margin-right: -1px !important;
    21 
    22 }
    23 
     12}
    2413.search_list li, .mobile_search_list li {
    25 
    2614    display: block;
    27 
    2815    float: none !important;
    29 
    3016    border-top: 1px solid #fff;
    31 
    32 }
    33 
    34 
    35 
     17}
    3618.search_list li, .search_list li a, .search_list li a p, .mobile_search_list li, .mobile_search_list li a, .mobile_search_list li a p{
    37 
    3819    line-height: 25px !important;   
    39 
    40 }
    41 
    42 
    43 
     20}
    4421ul.search_list{
    45 
    4622    height: 500px !important;
    47 
    4823    overflow: auto;
    49 
    50 }
    51 
     24}
    5225p.list_type {
    53 
    5426    white-space: nowrap;
    55 
    5627    width: 70% !important;
    57 
    5828    overflow: hidden;
    59 
    6029    text-overflow: ellipsis;
    6130    height: 23px !important;
    62 
     31    text-align: left;
    6332    /*clear: both;*/
    64 
    65 }
    66 
     33}
     34p.list_type1 {
     35    white-space: nowrap;
     36    width: 90% !important;
     37    overflow: hidden;
     38    text-overflow: ellipsis;
     39    height: 23px !important;
     40    text-align: left;
     41    letter-spacing: .5px !important;
     42    /*clear: both;*/
     43}
    6744p.list_title {
    68 
    6945    font-weight: bold !important;
    70 
    7146    text-transform: capitalize !important;
    72 
     47    letter-spacing: 0.2px !important;
     48    font-size: 14px !important;
     49    width: 55% !important;
     50    white-space: nowrap;
     51    overflow: hidden;
     52    text-overflow: ellipsis;
     53    float: left;
     54    padding: 0px!important;
     55    margin: 0px!important;
     56}
     57p.list_status {
     58width: 25% !important;
     59}
     60.search_list li a, .mobile_search_list li {
     61    background-color: #019dc2 !important;
     62    color: #ffffff;
     63    border-left: 5px solid #23282d !important;
     64    border-right: 5px solid #23282d !important;
     65}
     66.search_list li a {
     67    height: 40px !important;
     68    padding: 10px 20px 20px 20px !important;
     69}
     70.mobile_search_list li a {
     71    height: 40px !important;
     72    padding: 10px 20px 20px 20px !important;
     73    display: block;
     74    box-sizing: content-box;
     75}
     76.search_list li a .list_status, .mobile_search_list li a .list_status{
     77    float: right;
     78    text-transform: uppercase !important;
     79}
     80.search_list li a .list_status, .search_list li a .list_type, .mobile_search_list li a .list_status, .mobile_search_list li a .list_type {
     81    font-size: 13px !important;
     82    font-family: arial;
     83}
     84.search_list li a:hover, .search_list li a.count_post, .mobile_search_list li.count_result {
     85    background-color: #23282d !important;
     86    color: #fff;
     87}
     88.search_list li a.count_post, .mobile_search_list li.count_result {
     89    text-align: center;
     90}
     91.search_list li a.count_post{
     92    height: 20px !important;
     93}
     94.search_list li a.count_post, .search_list li a.count_post .result-count, .mobile_search_list li a.count_post, .mobile_search_list li a.count_post .result-count{
     95    font-weight: bold !important;
     96}
     97.search_result, .none_result {
     98    width: 280px !important;
     99    word-wrap: break-word;
     100}
     101.image_thumb {
     102    float: left;
     103    width: 40px !important;
     104    height: 40px !important;
     105    margin-top: 5px !important;
     106    display: block;
     107    margin-right: 12px !important;
     108}
     109}
     110.result-count {
     111    line-height: normal !important;
     112}
     113.search_list > li:nth-child(10) ~ li, .mobile_search_list > li:nth-child(10) ~ li {
     114    /* this rule targets the rows after the 10th .row */
     115    display: none;
     116}
     117.search_list li:nth-last-child(1), .mobile_search_list li:nth-last-child(1) {
     118    display: block !important;
     119}
     120a.search_result {
     121    font-weight: bold !important;
     122    text-transform: capitalize !important;
    73123    letter-spacing: 1px !important;
    74 
    75     font-size: 15px !important;
    76 
    77     width: 55% !important;
    78 
     124    font-size: 14px !important;
     125}
     126.list_type, .list_status {
     127    letter-spacing: .5px !important;
     128}
     129.list_type {
     130    text-transform: capitalize !important;
     131}
     132.post_search_box {
     133    display: block !important;
     134}
     135#wpadminbar .ab-top-menu>li#wp-admin-bar-search_form:hover>.ab-item {
     136    background: transparent !important;
     137}
     138.fa-search {
     139    font: normal normal normal 14px/1 FontAwesome !important;
     140}
     141.ajax-loader {
     142  visibility: hidden;
     143  background-color: rgba(255,255,255,0.7);
     144  position: absolute;
     145  z-index: +100 !important;
     146  width: 100%;
     147  height:100%;
     148}
     149.ajax-loader img {
     150  position: relative;
     151  top:50%;
     152  left:50%;
     153}
     154.search_result {
     155    white-space: nowrap;
     156    overflow: hidden;
     157    text-overflow: ellipsis;
     158}
     159.advance_search_box .sf-d label {
     160    position: absolute !important;
     161    right: 0px;
     162    width: 30px !important;
     163    text-align: center;
     164    height: 30px !important;
     165    top: 1px;
     166    background: linear-gradient(45deg, #0eaed4, #0eaed4,#0eaed4);
     167}
     168.advance_search_box  #post_search_box  {
     169    height: 28px !important;
     170    margin: 0 !important;
     171}
     172#wp-admin-bar-search_form:hover label > .dashicons-search {
     173    color: #ffffff !important;
     174}
     175.ajax-loader img.img-responsive, .ajax-loading img {
     176    display: block;
     177    margin: 0 auto !important;
     178    height: 30px !important;
     179}
     180a.count_post.media_list {
     181    min-width: 280px;
     182}
     183.ajax-loading {
     184    background-color: #ffffff;
     185}
     186.dashicons-search {
     187    font: 24px dashicons !important;
     188    font-family: dashicons !important;
     189    color: #ffffff;
     190}
     191.dashicons-external:before {
     192    content: "\f504";
     193    top: 5px;
     194    left: 8px;
     195    position: relative;
     196}
     197ul.search_list::-webkit-scrollbar {
     198    display: none;
     199}
     200ul.search_list {
     201  -ms-overflow-style: none;  /* IE and Edge */
     202  scrollbar-width: none;  /* Firefox */
     203}
     204/*error*/
     205.php-error #adminmenuback, .php-error #adminmenuwrap{
     206    margin-top: 0 !important;
     207}
     208@media only screen and (max-width: 2560px) {
     209    ul.search_list {
     210       height: 780px !important;
     211    }
     212}
     213@media only screen and (max-width: 1440px){
     214    ul.search_list {
     215        height: 600px !important;
     216        overflow: auto;
     217    }
     218}
     219@media only screen and (max-width: 1024px){
     220    ul.search_list {
     221        height: 540px !important;
     222        overflow: auto;
     223    }
     224    .table_type {
     225        width: 13% !important;
     226    }
     227    .table_type1 {
     228        width: 11% !important;
     229    }
     230}
     231@media screen and (max-width: 768px) {
     232    .input_search,.select1{
     233        width: 153px !important;
     234    }
     235    .select1 {
     236        margin: 1px 5px 8px 5px !important;
     237    }
     238    .input_search{
     239        margin: 4px 5px 5px 5px !important;
     240    }
     241    .btn1 {
     242        width: 153px !important;
     243        padding: 8px 5px 8px 5px !important;
     244        margin: 0px 4px 4px 4px !important;
     245    }
     246    .table_type2 {
     247        width: 24% !important;
     248    }
     249}
     250@media screen and (max-width: 600px) {
     251    .sf-m {
     252        padding-top: 50px;
     253    }
     254    #wpbody {
     255        padding-top: 0 !important;
     256    }
     257}
     258@media screen and (min-width: 600px) and (max-width: 782px) {
     259    #search_fields {
     260        margin-top: 5px;
     261    }
     262}
     263@media screen and (max-width: 782px) {
     264     #wp-toolbar>ul>li#wp-admin-bar-search_form{
     265        display: block !important;
     266     }
     267     .sf-d {
     268        display: none;
     269     }
     270    .advance_search_box {
     271        width: 50px !important;
     272        top: 4px;
     273    }
     274    #wp-admin-bar-search_form.hover #post_search_box {
     275        display: block;
     276    }
     277    .sf-m {
     278        margin-right: 12px;
     279    }
     280    #mobile_search_fields {
     281        height: 40px;
     282        width: 90%;
     283    }
     284    .mobile_search_list li:last-child a.count_post {
     285        color: inherit;
     286        text-decoration: none;
     287    }
     288    .mobile_search_list, .mobile_search_list li, .list_type, .list_status {
     289        margin: 0;
     290    }
     291    .mobile_search_list li a {
     292        font-size: 16px;
     293    }
     294    .dashicons-search {
     295        font: 40px dashicons !important;
     296        font-family: dashicons !important;
     297        color: #ccc;
     298    }
     299    .sf-m .dashicons-search {
     300    margin-right: 10px;
     301    font-size: 30px !important;
     302    margin-top: 5px !important;
     303    }
     304    .search_result {
     305        color: #fff;
     306        text-decoration: none;
     307    }
     308    .list_type, .list_status {
     309        font-weight: normal;
     310    }
     311    .search_result {
     312        width: auto !important;
     313        display: block;
     314    }
     315    #search_fields {
     316        position: relative;
     317    }
     318    #search_fields label {
     319        background: #0077A4;
     320        display: inline-block;
     321        position: absolute;
     322        width: 10%;
     323        text-align: center;
     324        line-height: 41px;
     325        color: #ffffff;
     326        min-width: 40px;
     327        right: 0px;
     328        margin-bottom: 0;
     329    }
     330    .ajax-loading img {
     331        margin-top: 10px !important;
     332    }
     333}
     334@media screen and (min-width: 783px) {
     335     .dashicons-search, .sf-m {
     336        display: none !important;
     337     }
     338     input#post_search_box {
     339        max-width: 100%;
     340        text-indent: 8px;
     341    }
     342    .dashicons-search {
     343    margin-top: 3px !important;
     344    }
     345    .ajax-loader img.img-responsive, .ajax-loading img {
     346    padding: 10px !important;
     347    }
     348}
     349@media screen and (max-width: 425px) {
     350    .advanced-admin-wrapper form input, .advanced-admin-wrapper form select {
     351        max-width: 45% !important;
     352    }
     353    input#mobile_search_fields{
     354        outline: none;
     355    }
     356    input#open_advance_search {
     357        max-width: 10px !important;
     358        height: 16px;
     359    }
     360    .input_search{
     361        margin:4px 5px 8px 5px !important
     362    }
     363    .btn1 {
     364        width: 153px !important;
     365        padding: 8px 5px 8px 5px !important;
     366        margin: 5px 4px 4px 4px !important;
     367    }
     368    .select1 {
     369        margin: 1px 5px 6px 5px !important;
     370    }
     371    .page_title {
     372        line-height: 32px;
     373    }
     374}
     375@media only screen and (max-width: 330px) {
     376p.list_type {
     377        width: 50% !important;
     378    }
     379}
     380ul.search_list3 li {
     381  display:inline;
     382}
     383/* CSS Changes for page view */
     384.input_search {
     385    margin: 10px 5px 5px 0;
     386    width:169px;
     387}
     388.select1 {
     389    margin:2px 5px 5px 5px;
     390    width: 169px;
     391}
     392.input_value {
     393    margin-left: 5px;
     394    margin-top: 5px;
     395    margin-right: 6px;
     396}
     397.input_key {
     398    margin-right: 5px;
     399}
     400.btn1 {
     401    width: 169px;
     402    padding: 3px 5px 6px 5px;
     403    margin:0 1px 0px 5px;
     404    background: #0075A7;
     405    font-weight: bold;
     406    border: 1px solid #7da7ccf2;
     407    color: white;
     408}
     409.input_page {
     410    margin-left: 5px;
     411}
     412.center {
     413    text-align: center;
     414    margin-top: 20px;
     415}
     416.pagination {
     417    display: inline-block;
     418}
     419.pagination a {
     420    /* color: black;*/
     421    float: left;
     422    padding: 8px 16px;
     423    text-decoration: none;
     424    transition: background-color .3s;
     425    border: 1px solid #ddd;
     426    margin: 0 0px;
     427    font-family: sans-serif;
     428}
     429.pagination a.active {
     430    background-color: #0075A7;
     431    color: white;
     432    /* border: 1px solid #0075A7;*/
     433    outline: none;
     434}
     435.pagination a.isDisabled {
     436    cursor: not-allowed;
     437    background-color: #c1c1c1;
     438    color: white;
     439}
     440.pagination a.isDisabled:hover{
     441    background-color: #c1c1c1;
     442    color: white !important;
     443}
     444.pagination a:hover:not(.active) {
     445    background-color: #c1c1c1;
     446    color:#00a0d2;
     447    outline: none;
     448 }
     449.btn-color{
     450    background: #86939f;
     451    color: white;
     452}
     453.wp-core-ui select {
     454    border-radius: 0px;
     455}
     456.tb-heading {
     457    background: #23282d;
     458    color: white;
     459    font-size: 15px;
     460    letter-spacing: 0.3px;
     461    word-wrap: break-word;
     462}
     463.image_thumb1 {
     464    width: 40px !important;
     465    height: 40px !important;
     466}
     467.search_rows1{
     468    text-align: center;
     469}
     470.list_title1 {
     471    font-weight: bold !important;
     472    text-transform: capitalize !important;
     473    letter-spacing: 0.2px !important;
     474    font-size: 14px !important;
     475    width: 90% !important;
    79476    white-space: nowrap;
    80 
    81477    overflow: hidden;
    82 
    83478    text-overflow: ellipsis;
    84 
    85479    float: left;
    86 
    87480    padding: 0px!important;
    88 
    89481    margin: 0px!important;
    90 
    91 }
    92 
    93 
    94 
    95 p.list_status {
    96 
    97 width: 25% !important;
    98 
    99 }
    100 
    101 .search_list li a, .mobile_search_list li{
    102 
    103     background-color: #0073aa !important;
    104 
    105     color: #ffffff;
    106 
    107 }
    108 
    109 .search_list li a {
    110 
    111     height: 40px !important;
    112 
    113     padding: 10px 20px 20px 20px !important;
    114 
    115 
    116 
    117 }
    118 
    119 .mobile_search_list li a {
    120 
    121     height: 40px !important;
    122 
    123     padding: 10px 20px 20px 20px !important;
    124 
    125     display: block;
    126 
    127     box-sizing: content-box;
    128 
    129 }
    130 
    131 .search_list li a .list_status, .mobile_search_list li a .list_status{
    132 
    133     float: right;
    134 
    135     text-transform: uppercase !important;
    136 
    137 }
    138 
    139 .search_list li a .list_status, .search_list li a .list_type, .mobile_search_list li a .list_status, .mobile_search_list li a .list_type {
    140 
    141     font-size: 13px !important;
    142 
    143     font-family: arial;
    144 
    145 }
    146 
    147 .search_list li a:hover, .search_list li a.count_post, .mobile_search_list li.count_result {
    148 
    149     background-color: #23282d !important;
    150 
    151     color: #fff;
    152 
    153 }
    154 
    155 .search_list li a.count_post, .mobile_search_list li.count_result {
    156 
    157     text-align: center;
    158 
    159 }
    160 
    161 .search_list li a.count_post{
    162 
    163     height: 20px !important;
    164 
    165 }
    166 
    167 .search_list li a.count_post, .search_list li a.count_post .result-count, .mobile_search_list li a.count_post, .mobile_search_list li a.count_post .result-count{
    168 
    169     font-weight: bold !important;
    170 
    171 }
    172 
    173 .search_result, .none_result {
    174 
    175     width: 280px !important;
    176 
     482    text-align: left;
     483}
     484input[type=text]{
     485    border-radius: 0px !important;
     486}
     487table.table_fxd{
     488    table-layout: fixed;
     489    width: 100%;
     490    margin-top: 10px;
     491    padding: 0px;
     492}
     493#wpcontent {
     494    padding-right: 20px;
     495}
     496.td_rows {
    177497    word-wrap: break-word;
    178 
    179 }
    180 
    181 .image_thumb {
    182 
    183     float: left;
    184 
    185     width: 40px !important;
    186 
    187     height: 40px !important;
    188 
    189     margin-top: 5px !important;
    190 
    191     display: block;
    192 
    193     margin-right: 12px !important;
    194 
    195 }
    196 
    197 }
    198 
    199 .result-count {
    200 
    201     line-height: normal !important;
    202 
    203 }
    204 
    205 .search_list > li:nth-child(10) ~ li, .mobile_search_list > li:nth-child(10) ~ li {
    206 
    207     /* this rule targets the rows after the 10th .row */
    208 
    209     display: none;
    210 
    211 }
    212 
    213 .search_list li:nth-last-child(1), .mobile_search_list li:nth-last-child(1) {
    214 
    215     display: block !important;
    216 
    217 }
    218 
    219 a.search_result {
    220 
    221     font-weight: bold !important;
    222 
    223     text-transform: capitalize !important;
    224 
    225     letter-spacing: 1px !important;
    226 
    227     font-size: 14px !important;
    228 
    229 }
    230 
    231 .list_type, .list_status {
    232 
    233     letter-spacing: .5px !important;
    234 
    235 }
    236 
    237 .list_type {
    238 
    239     text-transform: capitalize !important;
    240 
    241 }
    242 
    243 .post_search_box {
    244 
    245     display: block !important;
    246 
    247 }
    248 
    249 #wpadminbar .ab-top-menu>li#wp-admin-bar-search_form:hover>.ab-item {
    250 
    251     background: transparent !important;
    252 
    253 }
    254 
    255 .fa-search {
    256 
    257     font: normal normal normal 14px/1 FontAwesome !important;
    258 
    259 }
    260 
    261 .ajax-loader {
    262 
    263   visibility: hidden;
    264 
    265   background-color: rgba(255,255,255,0.7);
    266 
    267   position: absolute;
    268 
    269   z-index: +100 !important;
    270 
    271   width: 100%;
    272 
    273   height:100%;
    274 
    275 }
    276 
    277 .ajax-loader img {
    278 
    279   position: relative;
    280 
    281   top:50%;
    282 
    283   left:50%;
    284 
    285 }
    286 
    287 .search_result {
    288 
    289     white-space: nowrap;
    290 
    291     overflow: hidden;
    292 
    293     text-overflow: ellipsis;
    294 
    295 }
    296 
    297 .advance_search_box .sf-d label {
    298 
    299     position: absolute !important;
    300 
    301     right: 0px;
    302 
    303     width: 30px !important;
    304 
    305     text-align: center;
    306 
    307     height: 30px !important;
    308 
    309     top: 1px;
    310 
    311     background: #0075A7;
    312 
    313 }
    314 
    315 .advance_search_box  #post_search_box  {
    316 
    317     height: 28px !important;
    318 
    319     margin: 0 !important;
    320 
    321 }
    322 
    323 #wp-admin-bar-search_form:hover label > .dashicons-search {
    324 
    325     color: #ffffff !important;
    326 
    327 }
    328 
    329 .ajax-loader img.img-responsive, .ajax-loading img {
    330 
    331     display: block;
    332 
    333     margin: 0 auto !important;
    334 
    335     height: 30px !important;
    336 
    337 }
    338 
    339 a.count_post.media_list {
    340 
    341     min-width: 280px;
    342 
    343 }
    344 
    345 .ajax-loading {
    346 
    347     background-color: #ffffff;
    348 
    349 }
    350 
    351 .dashicons-search {
    352 
    353     font: 24px dashicons !important;
    354 
    355     font-family: dashicons !important;
    356 
    357     color: #ccc;
    358 
    359 }
    360 
    361 @media only screen and (max-width: 2560px) {
    362 
    363 ul.search_list {
    364 
    365        height: 780px !important;
    366 
    367     }
    368 
    369 }
    370 
    371 @media only screen and (max-width: 1440px){
    372 
    373 ul.search_list {
    374 
    375     height: 600px !important;
    376 
    377     overflow: auto;
    378 
    379 }
    380 
    381 }
    382 
    383 @media only screen and (max-width: 1024px){
    384 
    385 ul.search_list {
    386 
    387     height: 540px !important;
    388 
    389     overflow: auto;
    390 
    391 }
    392 
    393 }
    394 
    395 @media screen and (max-width: 600px) {
    396 
    397     .sf-m {
    398 
    399         padding-top: 50px;
    400 
    401     }
    402 
    403     #wpbody {
    404 
    405         padding-top: 0 !important;
    406 
    407     }
    408 
    409 }
    410 
    411 @media screen and (min-width: 600px) and (max-width: 782px) {
    412 
    413     #search_fields {
    414 
    415         margin-top: 5px;
    416 
    417     }
    418 
    419 }
    420 
    421 @media screen and (max-width: 782px) {
    422 
    423      #wp-toolbar>ul>li#wp-admin-bar-search_form{
    424 
    425         display: block !important;
    426 
    427      }
    428 
    429      .sf-d {
    430 
    431         display: none;
    432 
    433      }
    434 
    435     .advance_search_box {
    436 
    437         width: 50px !important;
    438 
    439         top: 4px;
    440 
    441     }
    442 
    443     #wp-admin-bar-search_form.hover #post_search_box {
    444 
    445         display: block;
    446 
    447     }
    448 
    449     .sf-m {
    450 
    451         margin-right: 12px;
    452 
    453     }
    454 
    455     #mobile_search_fields {
    456 
    457         height: 40px;
    458 
    459         width: 90%;
    460 
    461     }
    462 
    463     .mobile_search_list li:last-child a.count_post {
    464 
    465         color: inherit;
    466 
    467         text-decoration: none;
    468 
    469     }
    470 
    471     .mobile_search_list, .mobile_search_list li, .list_type, .list_status {
    472 
    473         margin: 0;
    474 
    475     }
    476 
    477     .mobile_search_list li a {
    478 
    479         font-size: 16px;
    480 
    481     }
    482 
    483    
    484 
    485     .dashicons-search {
    486 
    487         font: 40px dashicons !important;
    488 
    489         font-family: dashicons !important;
    490 
    491         color: #ccc;
    492 
    493     }
    494 
    495     .sf-m .dashicons-search {
    496 
    497     margin-right: 10px;
    498 
    499     font-size: 30px !important;
    500 
    501     margin-top: 5px !important;
    502 
    503     }
    504 
    505     .search_result {
    506 
    507         color: #fff;
    508 
    509         text-decoration: none;
    510 
    511     }
    512 
    513     .list_type, .list_status {
    514 
    515         font-weight: normal;
    516 
    517     }
    518 
    519     .search_result {
    520 
    521         width: auto !important;
    522 
    523         display: block;
    524 
    525     }
    526 
    527     #search_fields {
    528 
    529         position: relative;
    530 
    531     }
    532 
    533     #search_fields label {
    534 
    535         background: #0077A4;
    536 
    537         display: inline-block;
    538 
    539         position: absolute;
    540 
    541         width: 10%;
    542 
    543         text-align: center;
    544 
    545         line-height: 41px;
    546 
    547         color: #ffffff;
    548 
    549         min-width: 40px;
    550 
    551         right: 0px;
    552 
    553         margin-bottom: 0;
    554 
    555     }
    556 
    557     .ajax-loading img {
    558 
    559         margin-top: 10px !important;
    560 
    561     }
    562 
    563 }
    564 
    565 @media screen and (min-width: 783px) {
    566 
    567      .dashicons-search, .sf-m {
    568 
    569         display: none !important;
    570 
    571      }
    572 
    573      input#post_search_box {
    574 
    575         max-width: 100%;
    576 
    577         text-indent: 8px;
    578 
    579     }
    580 
    581     .dashicons-search {
    582 
    583     margin-top: 3px !important;
    584 
    585     }
    586 
    587     .ajax-loader img.img-responsive, .ajax-loading img {
    588 
    589     padding: 10px !important;
    590 
    591     }
    592 
    593 }
    594 
    595 @media only screen and (max-width: 330px) {
    596 
    597 p.list_type {
    598 
    599         width: 50% !important;
    600     }
    601 }
     498}
     499td {
     500    padding: 0px 10px 0px 10px;
     501    border: 0px solid #c7cad6bf;
     502}
     503table {
     504    border-spacing: 0px;
     505    border: 0px solid #c7cad6bf;
     506}
     507tr:nth-child(even) {
     508  background-color: #c6d2e4b3;
     509}
     510th {
     511    padding: 15px 0px !important;
     512}
     513.page_title {
     514    font-family: sans-serif;
     515    text-align: left;
     516    font-size: 26px;
     517    color: #0075a7;
     518    font-weight: 700;
     519}
     520.table_type {
     521    width: 10%;
     522}
     523.table_type1 {
     524    width: 10%;
     525}
     526.table_type2 {
     527    width: 35%;
     528}
     529.color {
     530    border-radius: 8px !important;
     531    padding: 2px 10px;
     532    font-weight: 700;
     533    letter-spacing: 0.6px;
     534    color: white;
     535}
     536td.result_row {
     537    text-transform: uppercase;
     538    font-size: 14px;
     539    letter-spacing: 1px;
     540    font-weight: 700;
     541    text-align: center;
     542    padding: 10px 0 10px;
     543    background: #ffffff;
     544    margin-top: 0;
     545    margin-bottom: 0;
     546    color: red;
     547}
     548/*Form design*/
     549.advanced-admin-wrapper {
     550            width: 100%;
     551            max-width: 100%;
     552            margin-top: 20px;
     553        }
     554        .advanced-admin-wrapper img.banner-image {
     555            width: 100%;
     556            border: 1px solid #933afb;
     557        }
     558        h2.page_title_AASKP {
     559            margin: 0;
     560            padding: 20px;
     561            background: linear-gradient(45deg, #9538fc, #0eaed4,#0eaed4);
     562            color: #ffffff;
     563            text-transform: uppercase;
     564            letter-spacing: 1px;
     565        }
     566        .advanced-admin-wrapper form input, .advanced-admin-wrapper form select {
     567            width: 100%;
     568            max-width: 23%;
     569            padding: 10px;
     570            border: 1px solid #cecece;
     571            letter-spacing: 1px;
     572            font-size: 13px;
     573        }
     574        .advanced-admin-wrapper form select{
     575            text-transform: capitalize;
     576        }
     577        .button_AASKP {
     578            padding: 15px !important;
     579            background: linear-gradient(45deg, #9538fc, #0eaed4,#0eaed4);
     580            letter-spacing: 1px;
     581            cursor: pointer;
     582            outline: none;
     583        }
     584        .button_AASKP:hover {
     585            background: #0fafd5;
     586            transition: 1s ease;
     587        }
     588        .advanced-admin-wrapper form {
     589            background: white;
     590            padding: 20px;
     591        }
     592        tr.search_rows.tb-heading th {
     593            color: #ffffff;
     594            text-transform: uppercase;
     595            letter-spacing: 1px;
     596            font-size: 12px;
     597        }
     598        .advanced-admin-wrapper form p {
     599            padding: 0;
     600            margin-top: 0;
     601            font-size: 12px;
     602            letter-spacing: 1px;
     603            margin-bottom: 0;
     604            text-transform: uppercase;
     605            font-weight: 500;
     606        }
     607        h2.search_result_count {
     608            text-transform: uppercase;
     609            font-size: 14px;
     610            letter-spacing: 1px;
     611            font-weight: 700;
     612            text-align: center;
     613            padding: 10px 0 20px;
     614            background: #ffffff;
     615            margin-top: 0;
     616            margin-bottom: 0;
     617        }
     618        h2.search_result_count span {
     619            background: linear-gradient(45deg, #9538fc, #0eaed4);
     620            color: #ffffff;
     621            border-radius: 8px;
     622            padding: 2px 10px;
     623        }
     624        .advanced-admin-wrapper form input:disabled{
     625            color: #a0a5aa;
     626            border-color: #ddd;
     627            background-color: #f1f1f1;
     628            box-shadow: none;
     629            text-shadow: 0 1px 0 #fff;
     630            cursor: default;
     631            transform: none;
     632            cursor: not-allowed;
     633        }
     634        .advanced-admin-wrapper form select:disabled {
     635            color: #23282d !important;
     636            border-color: #ddd;
     637            background-color: #efefef !important;
     638            background-image: url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23a0a5aa%22%2F%3E%3C%2Fsvg%3E);
     639            box-shadow: none;
     640            text-shadow: 0 1px 0 #fff;
     641            cursor: default;
     642            transform: none;
     643            cursor: not-allowed;
     644        }
     645        .advanced_search p {
     646            font-size: 12px !important;
     647            margin-bottom: 0;
     648            margin-top: 8px !important;
     649            text-transform: uppercase;
     650        }
     651        input#open_advance_search {
     652            width: 100%;
     653            max-width: 10px;
     654            position: relative;
     655            top: -1px;
     656            border: 1px solid #cecece;
     657            left: 0;
     658        }
     659        label.highlighted_adv_label {
     660            margin-left: 0;
     661            position: relative;
     662            top: -1px;
     663            font-size: 11px;
     664            text-transform: initial;
     665            color: red;
     666        }
  • advanced-admin-search/trunk/index.php

    r2207029 r2474185  
    1 <?php
    2 
    3 // Silence is golden
     1<?php // Silence is golden
  • advanced-admin-search/trunk/js/jquery-admin-desktop-search.js

    r2207029 r2474185  
    8585            var search=jsonData['search'];
    8686
     87            var myCustomsearch='"'+jsonData['search']+'"';
     88
    8789
    8890
     
    9496
    9597                    "</span> Result not Found. Please Refine Your Search</a></li>");
    96 
    9798                }else{  //display the found results
    98 
    9999                    $.each(jsonData['data'], function(key, values){
    100100
     
    161161                    });
    162162
    163                     jQuery( ".search_list" ).append("<li class='count_result' onclick='AlertMessage()'><a class='count_post media_list' href='#'>"+search+" search has <span class='result-count'>"+count+"</span> results.</a></li> ");
     163                    jQuery( ".search_list" ).append("<li class='count_result' onclick='ASAK_pageView("+myCustomsearch+")'><a class='count_post media_list' href='#'>View all <span class='result-count'>"+count+"</span> search results</a></li> ");
    164164
    165165                }
     
    243243
    244244
    245 function AlertMessage(){
    246 
    247     alert('This feature is coming soon.');
    248 
     245function ASAK_pageView(myCustomsearch){
     246
     247    window.location.href="tools.php?page=advanced-admin-search&keyword="+myCustomsearch;
    249248}
    250249
  • advanced-admin-search/trunk/js/jquery-admin-mobile-search.js

    r2207029 r2474185  
    8484            var search=jsonData['search'];
    8585
     86            var myCustomsearch='"'+jsonData['search']+'"';
    8687           
    8788
     
    160161                    });
    161162
    162                     jQuery( ".mobile_search_list" ).append("<li class='count_result' onclick='AlertMessage()'><a class='count_post media_list' href='#'>"+search+" search has <span class='result-count'>"+count+"</span> results.</a></li> ");
     163                    jQuery( ".mobile_search_list" ).append("<li class='count_result' onclick='ASAK_pageView("+myCustomsearch+")'><a class='count_post media_list' href='#'>View all <span class='result-count'>"+count+"</span> search results</a></li> ");
    163164
    164165                }
     
    244245
    245246
    246 function AlertMessage(){
    247 
    248     alert('This feature is coming soon.');
    249 
    250 }
    251 
     247function ASAK_pageView(myCustomsearch){
     248
     249    window.location.href="tools.php?page=advanced-admin-search&keyword="+myCustomsearch;
     250}
     251
  • advanced-admin-search/trunk/scripts.php

    r2207029 r2474185  
    11<?php
    2 
    32namespace Kuroit\AdvancedAdminSearch;
    4 
    5 
    6 
    73class AASKP_SearchData
    8 
    94{
    10 
    115    public function __construct()
    12 
    136    {
    14 
    157        // Hooks to get the searching data like admin menu, media labraries, post, pages.
    168       
    179        add_action('admin_bar_menu', array($this, 'AASKP_desktopSearchJavascript'));
    18 
    1910        add_action('in_admin_header', array($this, 'AASKP_mobileSearchJavascript'));
    20 
    21 
    22 
     11        //add_action('in_admin_header', array($this, 'AASKP_pageSearchJavascript'));
    2312        // Hooks to add javascript.
    24 
    2513        add_action('admin_enqueue_scripts', array($this, "AASKP_adminJavascript"));
    26 
    2714        add_action('wp_enqueue_scripts', array($this, "AASKP_adminJavascript"));
    28 
    29 
    30 
    3115    }
    32 
    3316    public function AASKP_desktopSearchJavascript()
    34 
    3517    {
    36 
    3718        echo '<script type="text/javascript"> AASKP_desktopSearch(); </script>';
    38 
    3919    }
    40 
     20    //  public function AASKP_pageSearchJavascript()
     21    // {
     22    //     echo '<script type="text/javascript"> AASKP_pageSearch(); </script>';
     23    // }
    4124    public function AASKP_mobileSearchJavascript()
    42 
    4325    {
    44 
    4526        echo '<script type="text/javascript"> AASKP_mobileSearch(); </script>';
    46 
    4727    }
    48 
    4928    function AASKP_adminJavascript()
    50 
    5129    {
    52 
    5330        wp_enqueue_style( 'advanced_admin_search_style',  plugin_dir_url( __FILE__ ) . 'css/style.css' );
    54 
    5531        wp_register_script('advanced_admin_desktop_search_script' , plugin_dir_url( __FILE__ ) . 'js/jquery-admin-desktop-search.js' );
    56 
    5732        wp_register_script('advanced_admin_mobile_search_script' , plugin_dir_url( __FILE__ ) . 'js/jquery-admin-mobile-search.js' );
    58 
    59 
    60 
     33        wp_register_script('advanced_admin_page_search_script' , plugin_dir_url( __FILE__ ) . 'js/jquery-admin-page-search.js' );
    6134        $params = array(
    62 
    6335                'ajaxurl' => admin_url('admin-ajax.php'),
    64 
    6536                'ajax_nonce' => wp_create_nonce('advanced_search_submit'),
    66 
    6737            );
    68 
    69 
    70 
    7138        wp_localize_script( 'advanced_admin_desktop_search_script', 'advanced_admin_search', $params );
    72 
    7339        wp_localize_script( 'advanced_admin_mobile_search_script', 'advanced_admin_search', $params );
    74 
    75 
     40        wp_localize_script( 'advanced_admin_page_search_script', 'advanced_admin_search', $params );
    7641        //register and enqueue script
    7742        wp_enqueue_script( 'advanced_admin_desktop_search_script' );
    78 
    7943        wp_enqueue_script( 'advanced_admin_mobile_search_script' );
    80 
    81 
    82 
     44       
     45        wp_enqueue_script( 'advanced_admin_page_search_script' );
    8346    }
    84 
    8547}
    86 
  • advanced-admin-search/trunk/searchbox.php

    r2207029 r2474185  
    11<?php
    2 
    32namespace Kuroit\AdvancedAdminSearch;
    4 
    5 
    6 
    73class AASKP_SearchBox
    8 
    94{
    10 
    115    public function __construct()
    12 
    136    {
    147        //hooks to add search box to admin bar
    158        add_action('admin_bar_menu', array($this, 'AASKP_displaySearchBox'));
    16 
    179        add_action('in_admin_header', array($this, 'AASKP_displayInput'));
    18 
    1910    }
    20 
    2111   
    2212    public function AASKP_displaySearchBox()
    23 
    2413    {
    25 
    2614        global $wp_admin_bar;
    27 
    2815            $wp_admin_bar->add_menu(array('id' => 'search_form',
    29 
    3016                'parent' => 'top-secondary',
    31 
    3217                'title' => '<ul class="post_search_box">
    33 
    3418                <li class="advance_search_box"><span class="dashicons dashicons-search"
    35 
    3619                onclick="AASKP_displayInputBox()"></span><div class="sf-d"><input
    37 
    3820                name="autocomplete" type="text" placeholder="Search Database"
    39 
    4021                id="post_search_box" autocomplete="off" style="height:20px;margin:5px
    41 
    4222                0;"/><label for="submit"><span class="dashicons dashicons-search"
    43 
    4423                style="display:block !important;"></span></label><input type="submit"
    45 
    4624                id="submit" name="search" value="Search" style="display:none;"><div
    47 
    4825                class="ajax-loader" style="display: none;"><img src="'.plugin_dir_url
    49 
    5026                (__FILE__).'image/loading.gif" class="img-responsive" /></div><ul
    51 
    5227                class="search_list"></ul></div></li>
    53 
    5428                </ul>'));
    55 
    5629    }
    57 
    5830    public function AASKP_displayInput()
    59 
    6031    {
    61 
    6232            echo '<div class="sf-m"><div id="search_fields" style="display:none;">
    63 
    6433            <input type="text" placeholder="Search Database" id="mobile_search_fields"
    65 
    6634            autocomplete="off" style="line-height:1em;"/><label for="submit"><span
    67 
    6835            class="dashicons dashicons-search"></span></label><input type="submit"
    69 
    7036            id="submit" name="search" value="Search" style="display:none;"></div>
    71 
    7237            <div class="ajax-loading"><img src="'.plugin_dir_url(__FILE__).'image/loading.gif"
    73 
    7438            class="img-responsive" /></div><ul class="mobile_search_list">
    75 
    7639            </ul></div>';
    77 
    7840    }
    79 
    8041}
    81 
  • advanced-admin-search/trunk/searchresults.php

    r2207029 r2474185  
    11<?php
    2 
    32namespace Kuroit\AdvancedAdminSearch;
    4 
    53//class for searching results
    64class AASKP_searchResults
    7 
    85{
    9 
     6    protected static $instance = false;
    107    public function __construct() // instantiation
    11 
    12     {
    13 
     8    {
    149        add_action('wp_ajax_search_result', array($this, 'AASKP_searchAction'));
    15 
    16     }
    17 
    18 
    19 
     10    }
    2011    public function AASKP_searchAction() //retrieve the results
    21 
    22     {
    23 
    24 
    25 
     12    {
    2613        if (isset($_POST['post_search']) && isset($_POST['security'])) {
    27 
    28                 $post_search = sanitize_text_field($_POST['post_search']);
    29 
    30                 $security_check = sanitize_text_field($_POST['security']);
    31 
    32                 $check = wp_create_nonce('advanced_search_submit');
    33 
     14            $post_search = sanitize_text_field($_POST['post_search']);
     15            $security_check = sanitize_text_field($_POST['security']);
     16            $check = wp_create_nonce('advanced_search_submit');
    3417            if ($security_check == $check) {
    35 
    3618                $results = array(); // all results available for search
    37 
    3819                if (!empty($post_search)) {
    39 
    40                         $post_types = get_post_types(array('public' => true));
    41 
    42                         $post_types = array_values($post_types);
    43 
    44                         // get pre search results from hook
    45 
    46                         $pre_filtered_result = apply_filters('aaskp_pre_search', $post_search);
    47 
     20                    $filters=array();
     21                    $post_types = get_post_types(array('public' => true));
     22                    $post_types = array_values($post_types);
     23                    // get pre search results from hook
     24                    $pre_filtered_result = apply_filters('aaskp_pre_search', $post_search);
     25                   
    4826                    if (is_array($pre_filtered_result)) {
    49 
    50                             $results = array_merge($results, $pre_filtered_result);
    51 
    52                     }
    53 
    54 
    55 
    56                         $results = array_merge(
    57 
    58                             $results, // pre search
    59 
    60                             $this->AASKP_getUsers($post_search),  // user results
    61 
    62                             $this->AASKP_getPostsAndPages($post_search), // post types
    63 
    64                             $this->AASKP_getMedia($post_search), // attachments
    65 
    66                             $this->AASKP_getTaxonomies($post_search), // taxonomies
    67 
    68                             $this->AASKP_getPostMeta($post_search), // post meta
    69 
    70                             $this->AASKP_getComments($post_search) // comments
    71 
    72                         );
    73 
    74                         // get post search results from hook
    75 
    76                         $post_filtered_result = apply_filters('aaskp_post_search', $post_search);
    77 
     27                        $results = array_merge($results, $pre_filtered_result);
     28                    }
     29                    $results = array_merge(
     30                        $results, // pre search
     31                        $this->AASKP_getUsers($post_search,$filters),  // user results
     32                        $this->AASKP_getPostsAndPages($post_search,$filters), // post types
     33                        $this->AASKP_getMedia($post_search,$filters), // attachments
     34                        $this->AASKP_getTaxonomies($post_search,$filters), // taxonomies
     35                        $this->AASKP_getPostMeta($post_search,$filters), // post meta
     36                        $this->AASKP_getComments($post_search,$filters) // comments
     37                    );
     38                    $post_filtered_result = apply_filters('aaskp_post_search', $post_search);
    7839                    if (is_array($post_filtered_result)) {
    79 
    80                             $results = array_merge($results, $post_filtered_result);
    81 
    82                     }
    83 
     40                        $results = array_merge($results, $post_filtered_result);
     41                    }
    8442                    //results conversion to json
    8543                    echo json_encode(array('result'=>'success', 'data'=>$results, 'count'=>count($results), 'search'=>$post_search));
    86 
    87                 }
    88 
    89                 else {
    90 
    91                      echo json_encode(array('result'=>'success', 'count'=> count($results)));
    92 
    93                 }
    94 
     44                }
     45                else {
     46                    echo json_encode(array('result'=>'success', 'count'=> count($results)));
     47                }
    9548            } else {
    96 
    9749                echo json_encode(array('result'=>'error', 'message'=>'Invalid Request'));
    98 
    99             }
    100 
     50            }
    10151        } else {
    102 
    103                 echo json_encode(array('result'=>'none', 'message'=>'Refine Your Search'));
    104 
    105         }
    106 
    107             wp_die();
    108 
    109     }
    110 
    111 
    112 
    113     public function AASKP_getUsers($post_search)
    114 
    115     {
    116 
     52            echo json_encode(array('result'=>'none', 'message'=>'Refine Your Search'));
     53        }
     54        wp_die();
     55    }
     56    public function AASKP_getUsers($post_search,$filters,$flag = false)
     57    {
     58               
     59        $output = array();
     60        if($flag) {
     61            if(!empty($filters['status'])  || !empty($filters['user']) || !empty($filters['metaKey']) || !empty($filters['metaValue'])) {
     62                return $output;
     63            }
     64        }
     65       
     66        $users = get_users(array('search' => "*{$post_search}*", 'fields' => array('display_name', 'user_registered', 'id')));
     67        foreach ($users as $user) {
     68            $url = admin_url('user-edit.php?user_id='.$user->id);
     69            $getUser = get_userdata($user->id);
     70            $role = $getUser->roles;
     71            foreach ($role as $value) {
     72                $output[] = array(
     73                    'link'      => $url,
     74                    'title'     => $user->display_name,
     75                    'status'    => $value,
     76                    'info'      => $user->user_registered,
     77                    'image'     => esc_url(get_avatar_url($user->id)),
     78                    'type'    => 'User'
     79                );
     80            }
     81        }
     82        return $output;
     83    }
     84    public function AASKP_getPostsAndPages($post_search,$filters,$flag = false)
     85    {
     86        $output = array();
     87        $args = array(
     88            's'                 => $post_search,
     89            'post_type'         => 'any',
     90            'post_status'       => array('publish', 'pending', 'draft',
     91            'auto-draft', 'future', 'private', 'trash'),
     92            'posts_per_page'    => -1
     93        );
     94        if($flag) {
     95            if(!empty($filters['status'])) {
     96                $args['post_status']=$filters['status'];
     97            }
     98            if(!empty($filters['user'])) {
     99                if(is_numeric($filters['user'])) {
     100                    $args['author'] = $filters['user'];
     101                }
     102                else {
     103                 $args['author_name'] = $filters['user'];
     104                }
     105            }
     106         
     107            $metaQuery= array();
     108            if (!empty($filters['metaKey'])) {
     109                $metaQuery=array(
     110                        'key' => $filters['metaKey']
     111                );             
     112            }
     113            if (!empty($filters['metaValue'])) {
     114                $value=$filters['metaValue'];
     115                $matchType=$filters['matchType'];
     116                switch($matchType) {
     117                    case "starting":
     118                        $compare='REGEXP';
     119                        $value='^'.$value;
     120                        break;
     121                    case "ending":
     122                        $compare='REGEXP';
     123                        $value=$value.'$';
     124                        break;
     125                    case 0:
     126                    case "exact":
     127                        $compare='=';
     128                }
     129                $metaValueQuery=array(
     130                            'value' => $value,
     131                            'compare' => $compare                 
     132                        );
     133                $metaQuery= array_merge($metaQuery,$metaValueQuery); 
     134            }
     135            if(!empty($metaQuery)) {
     136       
     137                $args['meta_query']=array($metaQuery);
     138            }
     139        }
     140        $query = new \WP_Query($args);
     141                   
     142        $posts = $query->posts;
     143        foreach ($posts as $post) {
     144                $url = admin_url('post.php?post='.$post->ID.'&action=edit');
     145                $post_type = $post->post_type;
     146                $output[]=array(
     147                    'link'      => $url,
     148                    'title'     => $post->post_title,
     149                    'status'    => $post->post_status,
     150                    'info'      => 'Type: '.$post->post_type,
     151                    'type'    => 'Post'
     152                );
     153        }
     154        return $output;
     155    }
     156    public function AASKP_getMedia($post_search,$filters,$flag = false)
     157    {
     158        $output = array();
     159        $args=array(
     160            's'                 => $post_search,
     161            'post_type'         => 'attachment',
     162            'post_status'       => 'inherit',
     163            'posts_per_page'    => -1
     164        );
     165        if($flag) {
     166            if(!empty($filters['metaKey']) || !empty($filters['metaValue'])) {
     167                return $output;
     168            }
     169            if(!empty($filters['status'])) {
     170                $args['post_status']=$filters['status'];   
     171            }
     172       
     173            if(!empty($filters['user'])) {
     174                if(is_numeric($filters['user'])) {
     175                    $args['author'] = $filters['user'];
     176                }
     177                else {
     178                    $args['author_name'] = $filters['user'];
     179                }
     180            }
     181        }
     182        $mediaPosts = get_posts($args);
     183        foreach ($mediaPosts as $mediaPost) {
     184                $url = admin_url('post.php?post='.$mediaPost->ID.'&action=edit');
     185                $post_type = $mediaPost->post_type;
     186                $image_url = wp_get_attachment_image_src($mediaPost->ID);
     187                $image_url_main = $image_url[0];
     188                if($image_url_main == false){
     189                    $image_url = '';
     190                }
     191                $output[]=array(
     192                    'link' => $url,
     193                    'title' => $mediaPost->post_title,
     194                    'info' => $mediaPost->post_date,
     195                    'image'=> $image_url_main,
     196                    'type' => 'Media'
     197                );
     198        }
     199        return $output;
     200    }
     201    public function AASKP_getTaxonomies($post_search,$filters,$flag = false)
     202    {
    117203            $output = array();
    118 
    119 
    120 
    121             $users = get_users(array('search' => "*{$post_search}*", 'fields'
    122 
    123             => array('display_name', 'user_registered', 'id')));
    124 
    125 
    126 
    127         foreach ($users as $user) {
    128 
    129                 $url = admin_url('user-edit.php?user_id='.$user->id);
    130 
    131                 $getUser = get_userdata($user->id);
    132 
    133                 $role = $getUser->roles;
    134 
    135 
    136 
    137             foreach ($role as $value) {
    138 
    139                     $output[] = array(
    140 
     204            if($flag) {
     205                if(!empty($filters['status']) || !empty($filters['user']) || !empty($filters['metaKey']) || !empty($filters['metaValue'])) {
     206                    return $output;
     207                }
     208            }
     209           
     210            $taxonomies = get_terms(
     211                array('search' => $post_search)
     212            );
     213        foreach ($taxonomies as $taxonomy) {
     214                $url = admin_url('term.php?taxonomy='.$taxonomy->taxonomy.
     215                '&tag_ID='.$taxonomy->term_id.'&post_type=post&wp_http_referer
     216                =%2Fwp-admin%2Fedit-tags.php%3Ftaxonomy%3Dcategory');
     217                $output[]=array(
     218                    'link' => $url,
     219                    'title' => $taxonomy->name,
     220                    'info' => 'Taxonomy: '.$taxonomy->taxonomy,
     221                    'type' => 'Taxonomy'
     222                );
     223        }
     224        return $output;
     225    }
     226    public function AASKP_getPostMeta($post_search,$filters,$flag = false)
     227    {
     228        $output = array();
     229        if($flag) {
     230            if(!empty($filters['user']) || !empty($filters['user']) || !empty($filters['metaKey']) || !empty($filters['metaValue'])) {
     231                return $output;
     232            }
     233        }
     234        global $wpdb;
     235        $postMeta = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."postmeta WHERE meta_key LIKE '%".$post_search."%' OR meta_value LIKE '%".$post_search."%'");
     236        foreach ($postMeta as $meta) {
     237            $url = admin_url('post.php?post='.$meta->post_id.'&action=edit');
     238            $getPost = get_post($meta->post_id);
     239            if($flag)
     240            { 
     241                if ((strpos($meta->meta_key, $post_search) !== false)) {
     242                    if(empty($filters['status'])) {
     243                        $output[]=array(
     244                            'link'      => $url,
     245                            'title'     => $getPost->post_title,
     246                            'status'    =>'PostMeta',
     247                            'info'      =>  strip_tags($meta->meta_value),
     248                            'type'    => 'PostMeta'
     249                        );
     250                    }
     251                }
     252                else {
     253                    if(empty($filters['status'])) {
     254                        $output[]=array(
     255                            'link' => $url,
     256                            'title' => $getPost->post_title,
     257                            'status' => $getPost->post_status,
     258                            'info' => 'Meta Value: '.strip_tags($meta->meta_value),
     259                            'type' => 'PostMeta'
     260                        );
     261                    }
     262                    else {
     263                        if(strcmp($getPost->post_status, $filters['status']) == 0) {
     264                            $output[]=array(
     265                                'link' => $url,
     266                                'title' => $getPost->post_title,
     267                                'status' => $getPost->post_status,
     268                                'info' => 'Meta Value: '.strip_tags($meta->meta_value),
     269                                'type' => 'PostMeta'
     270                            );
     271                        } 
     272                    }
     273                }
     274            }
     275               
     276            else {
     277                if (strpos($meta->meta_key, $post_search) !== false) {
     278                   
     279                        $output[]=array(
     280                            'link' => $url,
     281                            'title' => $getPost->post_title,
     282                            'status' =>'PostMeta',
     283                            'info' =>  strip_tags($meta->meta_value),
     284                            'type' => 'PostMeta'
     285                        );
     286                }
     287                else {
     288                               
     289                    $output[]=array(
    141290                        'link' => $url,
    142 
    143                         'title' => $user->display_name,
    144 
    145                         'status' => $value,
    146 
    147                         'info' => $user->user_registered,
    148 
    149                         'image' => esc_url(get_avatar_url($user->ID))
    150 
     291                        'title' => $getPost->post_title,
     292                        'status' => $getPost->post_status,
     293                        'info' => 'Meta Value: '.strip_tags($meta->meta_value),
     294                        'type' => 'PostMeta'
    151295                    );
    152 
    153             }
    154 
    155         }
    156 
    157             return $output;
    158 
    159     }
    160 
    161 
    162 
    163     public function AASKP_getPostsAndPages($post_search)
    164 
    165     {
    166 
    167             $output = array();
    168 
    169             $posts = get_posts(
    170 
    171                 array(
    172 
    173                     's'                 => $post_search,
    174 
    175                     'post_status'       => array('publish', 'pending', 'draft',
    176 
    177                     'auto-draft', 'future', 'private', 'trash'),
    178 
    179                     'post_type'         => 'any',
    180 
    181                     'posts_per_page'    => -1
    182 
    183                 )
    184 
     296                }
     297            }
     298        }
     299        return $output;
     300    }
     301    public function AASKP_getComments($post_search,$filters,$flag = false)
     302    {
     303        $output = array();
     304        $args=array('search' => $post_search);
     305        if($flag){
     306            if(!empty($filters['status']) || !empty($filters['metaKey']) || !empty($filters['metaValue'])) {
     307                return $output;
     308            } 
     309            if(!empty($filters['user'])) {
     310                $user=$filters['user'];
     311                if(is_numeric($user)) {
     312                    $args['user_id'] = $user;
     313                }
     314                else {
     315                    $userData=get_user_by('login', $user);
     316                    $args['user_id'] = $userData->ID;
     317                }
     318            }
     319        }
     320        $comments = get_comments($args);
     321        foreach ($comments as $comment) {
     322            $url = admin_url('edit-comments.php');
     323            $output[]=array(
     324                'link' => $url,
     325                'title' => $comment->comment_author_email,
     326                'info' =>'Comment'. $comment->comment_content,
     327                'type' => 'Comment'
    185328            );
    186 
    187         foreach ($posts as $post) {
    188 
    189                 $url = admin_url('post.php?post='.$post->ID.'&action=edit');
    190 
    191                 $post_type = $post->post_type;
    192 
    193                 $output[]=array(
    194 
    195                     'link' => $url,
    196 
    197                     'title' => $post->post_title,
    198 
    199                     'status' => $post->post_status,
    200 
    201                     'info' => 'Type: '.$post->post_type,
    202 
    203 
    204 
    205                 );
    206 
    207         }
    208 
    209             return $output;
    210 
    211     }
    212 
    213 
    214 
    215     public function AASKP_getMedia($post_search)
    216 
    217     {
    218 
    219             $output = array();
    220 
    221             $mediaPosts = get_posts(
    222 
    223                 array(
    224 
    225                     's' => $post_search,
    226 
    227                     'post_type' => 'attachment',
    228 
    229                     'post_status' => 'inherit',
    230 
    231                     'posts_per_page' => -1
    232 
    233                 )
    234 
    235             );
    236 
    237         foreach ($mediaPosts as $mediaPost) {
    238 
    239                 $url = admin_url('post.php?post='.$mediaPost->ID.'&action=edit');
    240 
    241                 $post_type = $mediaPost->post_type;
    242 
    243                 $image_url = wp_get_attachment_image_src($mediaPost->ID);
    244 
    245 
    246 
    247                 $output[]=array(
    248 
    249                     'link' => $url,
    250 
    251                     'title' => $mediaPost->post_title,
    252 
    253 
    254 
    255                     'info' => $mediaPost->post_date,
    256 
    257                     'image'=> $image_url[0]
    258 
    259                 );
    260 
    261         }
    262 
    263             return $output;
    264 
    265     }
    266 
    267 
    268 
    269     public function AASKP_getTaxonomies($post_search)
    270 
    271     {
    272 
    273             $output = array();
    274 
    275             $taxonomies = get_terms(
    276 
    277                 array('search' => $post_search)
    278 
    279             );
    280 
    281 
    282 
    283         foreach ($taxonomies as $taxonomy) {
    284 
    285                 $url = admin_url('term.php?taxonomy='.$taxonomy->taxonomy.
    286 
    287                 '&tag_ID='.$taxonomy->term_id.'&post_type=post&wp_http_referer
    288 
    289                 =%2Fwp-admin%2Fedit-tags.php%3Ftaxonomy%3Dcategory');
    290 
    291                 $output[]=array(
    292 
    293                     'link' => $url,
    294 
    295                     'title' => $taxonomy->name,
    296 
    297                     'info' => 'Taxonomy: '.$taxonomy->taxonomy,
    298 
    299 
    300 
    301                 );
    302 
    303         }
    304 
    305 
    306 
    307             return $output;
    308 
    309     }
    310 
    311 
    312 
    313     public function AASKP_getPostMeta($post_search)
    314 
    315     {
    316 
    317             global $wpdb;
    318 
    319             $output = array();
    320 
    321 
    322 
    323             $postMeta = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."postmeta WHERE meta_key
    324 
    325             LIKE '%".$post_search."%' OR meta_value LIKE '%".$post_search."%'");
    326 
    327         foreach ($postMeta as $meta) {
    328 
    329                 $url = admin_url('post.php?post='.$meta->post_id.'&action=edit');
    330 
    331                 $getPost = get_post($meta->post_id);
    332 
    333             if (strpos($meta->meta_key, $post_search) !== false) {
    334 
    335                         $output[]=array(
    336 
    337                         'link' => $url,
    338 
    339                         'title' => $getPost->post_title,
    340 
    341                         'status' =>'PostMeta',
    342 
    343                         'info' =>  strip_tags($meta->meta_value),
    344 
    345 
    346 
    347                     );
    348 
    349             }
    350 
    351                         else {
    352 
    353                     $output[]=array(
    354 
    355                         'link' => $url,
    356 
    357                         'title' => $getPost->post_title,
    358 
    359                         'status' => $getPost->post_status,
    360 
    361                         'info' => 'Meta Value: '.strip_tags($meta->meta_value),
    362 
    363                     );
    364 
    365             }
    366 
    367         }
    368 
    369             return $output;
    370 
    371     }
    372 
    373 
    374 
    375     public function AASKP_getComments($post_search)
    376 
    377     {
    378 
    379             $output = array();
    380 
    381             $comments = get_comments(array('search' => $post_search));
    382 
    383 
    384 
    385         foreach ($comments as $comment) {
    386 
    387                 $url = admin_url('edit-comments.php');
    388 
    389                 $output[]=array(
    390 
    391                     'link' => $url,
    392 
    393                     'title' => $comment->comment_author_email,
    394 
    395                     'info' =>'Comment'. $comment->comment_content,
    396 
    397 
    398 
    399                 );
    400 
    401         }
    402 
    403 
    404 
    405         return $output;
    406 
    407     }
    408 
     329        }
     330        return $output;
     331    }
     332    public static function getInstance(){
     333        if(self::$instance == false){
     334            self::$instance = new AASKP_searchResults();
     335        }
     336        return self::$instance;
     337    }
    409338}
    410 
     339AASKP_searchResults::getInstance();
Note: See TracChangeset for help on using the changeset viewer.